Very simple, but I always seem to forget the format:
tar -cvvf name.tar dir/ --exclude dir_to_exclude directory
You actually need to use the full path and sometimes swap the order:
tar -cvf name.tar --exclude "/full/path/dir/exclude_this" /full/path/dir/
Here’s a couple more tar commands for good measure:
tar -cvvf file.tar file.txt (tar file) tar -cvvf file.tar home/ (tar dir) tar -xvvf file.tar (untar) tar -xvf file.tar (view) tar -cvvf archives/20040918.tar *php *txt (example)
RSS feed for comments on this post · TrackBack URI
Leave a reply