Virtual Brain Online Logo

Bookmark: Root \ Linux \ Exclude a directory with tar

Exclude a directory with tar


Last Updated: 2006-07-15

In order to exclude a directory from a tar archive you need to create an exclude file first then have tar read it.
Replace DIRECTORYNAME with the name of the directory you wish to exclude.
Replace PATH with you path, both PATH should be the same.


Command:
find . -name DIRECTORYNAME -print > /PATH/exclude
tar zcvfX /PATH/ARCHIVE.tar.gz /PATH/exclude .

Originally Posted by Skylinux @ 2006-07-14 22:10:46

 

No Comments yet .....

 

Add Your Comment:

Note: All posts require administrator approval. Please allow 24 hours for message approval.

Name:
E-Mail:
Title
Plain text only, less then 65 000 characters.

Please remove the letter z from the word "zadzelskzronze" and tpye it into the answer box.

Please answer the question above and type the answer into the text box below.