Saves many files together into a single archive file, and restores individual files from the archive. Includes automatic archive compression/decompression options and special features for incremental and full backups.
(list contents of archive somefile.tar)
$ tar tvf somefile.tar
(extract contents of somefile.tar)
$ tar xvf somefile.tar
(extract contents of gzipped archive somefile.tar.gz)
$ tar xzvf somefile.tar.gz
(extract contents of bzip2 archive somefile.tar.bz2)
$ tar xjvf somefile.tar.bz2
(archive all ".c" files in current directory into one archive file)
$ tar cvf somefile.tar *.c
(archive and gzip-compress all files in a directory into one archive file)
$ tar czvf somefile.tar.gz somedirectory/
(archive and bzip2-compress all files in a directory into one archive file)
$ tar cjvf somefile.tar.bz2 somedirectory/
Other arguments for tar can be explored by using the man tar command.