![]() If you want to exclude folders from tar command, you can also include them, just like files, in –exclude option. ![]() $ tar -exclude='/home/ubuntu/data/projects.pdf' -exclude='/home/ubuntu/data/projects1.pdf' data.tar /home/ubuntu/data If you want to exclude multiple files include them one after the other with separate –exclude options as shown below. Here is an example to exclude file projects.pdf from tar command.Įxclude Files in Tar $ tar -exclude='/home/ubuntu/data/projects.pdf' data.tar /home/ubuntu/data ![]() Now if you want to exclude a file or folder present in /home/ubuntu/data folder include their path in –exclude option. Here is an example to tar a folder /home/ubuntu/data to data.tar $ tar data.tar /home/ubuntu/data Here is the basic command to tar a folder. In this article, we will learn how to exclude files & folders while using tar directory. You can easily do all this using tar command. You may need to exclude hidden files and files based on names and patterns. But sometimes while using tar command, you may need to exclude one or more files & directories. ![]() By default, tar will include all files & folders present in your input folder. It even allows you to compress them into. Tar is a popular Linux utility to archive one more files & folders in. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |