Unix Tar Command


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

comments powered by Disqus