tar -czvf myarchive.tgz mydirectory/linux
tar -czvf myarchive.tar.gz mydirectory/wordpress
We use the -t option to create an linux tar archive
spa
Note:that .tgz is the same thing as .tar.gz.code
tar -cvf myarchive.tar mydirectory/ip
tar -cvfj myarchive.tar.bz2 mydirectory/ci
tar -cvfj myarchive.tb2 mydirectory/it
tar -cvfj myarchive.tbz mydirectory/io
Note:To create highly compressed tar file we use option as j(filter the archive through bzip2).sed
Note: tar.bz2 and tbz is similar as tb2file
tar -xvzf mystuff.tgz
To untar or extract a tar file, just issue following command using option x (extract).
tar -xvf mystuff.tar
tar -xvjf mystuff.tar.bx2
tar -xvzf filename.tar.gz -C /desired/path
-C directory file
Reference media:
[1]http://linuxbasiccommands.wordpress.com/2008/04/04/linux-tar-command/
[2]http://www.tecmint.com/18-tar-command-examples-in-linux/