11 September 2006

Excluding specific file types using GNU tar

Posted by Mikhail Esteves under: LAMP; Tips .

You can specifically stop tar from archiving certain file types based on patterns (shell wildcards). For example, to archive everything in a directory excluding PDF and DOC files:

tar czvf archive.tgz --exclude=*.doc --exclude=*.pdf *

That creates a gzipped tarball with everything in the current directory minus PDF and DOC files. You can specify multiple --exclude parameters.



Leave a Reply

Browse

Photography

Projects

Pages

Calendar

September 2006
M T W T F S S
« Aug   Oct »
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

www.flickr.com

Use OpenDNS