Unix Tar Command
-
03 Apr 2013
Create
uncompressed
$ tar cvf [archive].tar [directory]
# c - create new archive
# v - verbose
# f - next argument is archive file name [archive]
gzip
$ tar cvzf [archive].tar.gz [directory]
bzip2
$ tar cvjf [archive].tar.bz2 [directory]
gzip vs bzip2
- bzip2 more time to compress/decompress
- bzip2 smaller size
Extract
uncompressed
$ tar xvf [archive]
# x - extract
gzip
$ tar xvzf [archive]
bzip2
$ tar xvjf [archive]
More Information
-
The Ultimate Tar Command Tutorial with 10 Practical Examples @ The Geek Stuff www.thegeekstuff.com/2010/04/unix-tar-command-examples/