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)
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Mar | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |
RSS feed for comments on this post · TrackBack URI
Leave a reply