Let’s see how to use an exclude file to ignore specific files and directories while archiving.įirst, we’ll create an exclude_file.txt file: $ touch exclude_file.txt Alternatively, we can use this command to list the contents of the file without extracting it:Īlternatively, we can provide the tar command with a file containing the list of files or directories to exclude when creating or extracting archive files. Since we used the -v option, we can see from the output above that file1.txt was skipped. We got the message “file changed as we read it” because we created the file in the same directory that contains the items to be archived. When excluding directories, we shouldn’t use the trailing slash(/) at the end of the directory name. ” at the end of the command as the path to the current working directory containing the files we want to archive. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |