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)
Incoming search terms:
- tar exclude directory
- tar exclude example
- tar exclude dir
- tar exclude directory example
- tar exclude directories
- exclude directory from tar
- tar exclude folder
- tar exclude empty directories
- tar exclude
- how to exclude directory in tar
Related posts:
