Make .tar and .zip file with terminal command
Make .tar and .zip file with terminal command
Creating a tar file:
tar -cvvf file.tar myfile.txt
In the above example the system would create a tar named file.tar in the directory you currently are in.
Wildcards could also be used in this command, for example: tar -cvvf file.tar *.txt would compress all txt files in the current directory.
tar -cvvf home.tar home/
In the above example command the system would create a tar file named home.tar in the directory you currently are in of the home directory.
Extracting the files from a tar file:
tar -xvvf myfile.tar
In the above example command the system would uncompress (untar) the myfile.tar file in the current directory.
tar -xvvzf myfile.tar.gz
In the above example command the system would uncompress (untar) the myfile.tar.gz file in the current directory.
Note: There is no "untar" linux / unix command.
Creating a tarred file that is compressed with bzip:
tar -cjvf test.tbz home/
From:http://www.computerhope.com/unix/utar.htm#03
Edited on Jan 19 2007 04:56PM by Nikolai Barnwell




