compress and uncompress: gzip, gunzip, gzcat (or zcat), gzmore (or zmore), zgrep gzip somefile --------> somefile.gz <------- gunzip gunzip === gzip -d (decompress) gzcat === gzip -cd (decompress and stdout) zmore === gzip -cd | more zgrep === gzip -cd | grep bzip2, bunzip2, bzcat, bzmore, bzgrep : similar as gzip's stuff bzip2 somefile --------> somefile.bz2 <------- bunzip2 tar: tape archive, combining several files together for archiving, or extracting some file from a backup tar file tar cf new-created.tar file-a dir-b # create a new tar file tar xf some.tar # extract contents tar rf existed.tar file-c file-d # append files to an existed tar file tar tf existed.tar # show the contents of a tar file The option 'v' can be used to give more verbose information. tar cvf new-created.tar ....... tar xvf some.tar tar rvf existed.tar ..... tar tvf existed.tar The file '-' is treated as stdin or stdout. tar cf - file-a file-b .. # the created tar file is sent to stdout tar xf - # the tar file is read from stdin Often two tar commands are combined with a pipe to make a copy of something. For example, the following command make a copy of filea and dira under another-dir. tar cf - filea dira | (cd another-dir; tar xf -) Even the source and destination can be at different machines. ssh remote-machine 'tar cf - .......' | tar xf - # note the quote A tar file is often compressed. For example: lame-398-2.tar.gz gzipped lame-398-2.tar scheme48-1.8.tgz tgz means tar.gz ypserv-2.22.tar.bz2 compressed with bzip2 You can create a compressed tar file either by $ tar cf new.tar fa fb .... $ gzip new.tar or $ tar zcf new.tar.gz fa fb .... z: gzip or $ tar jcf new.tar.bz2 fa fb ... j: bzip2 A compressed tar file can be extracted either by $ gunzip old.tar.gz # first step, uncompress $ tar xvf old.tar fa fb .... # second step, untar or $ gzip -cd old.tar.gz | tar xvf - # two steps combined with a pipe or # GNU-tar can do two steps together $ tar zxvf old.tar.gz fa fb .... z: gzip or $ tar jxvf old.tar.bz2 fa fb ... j: bzip2