![]() ![]() In this method, I'll be creating a text file containing the names of files and directories that I want to exclude. Using a text file to exclude files and directories mp3 file while creating tarball, then I'd have to follow the given command: tar -exclude='*.mp3' -zcvf. You just have to pair the file extension with the -exclude and it will get your job done.įor example, I want to exclude every. And if they have the same extension, things can get a lot easier! Use file extension to exclude files īut this command can get too long if you're supposed to exclude various files. To exclude multiple files and directories, you can use the chain of -exclude.įor example, I'll disclude Bash.sh and the subdirectory named Sub-Directory-1: tar -exclude='Bash.sh' -exclude='Sub-Directory-1' -zcvf. To check the contents of the tar file, you can use the tar command with the -tf option: tar -tf īut what about excluding multiple files and directories? Here you go. used at the end of the command indicates I want to utilize the current working directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |