Tuesday, July 28, 2015

How to create and how to extract a .tar file

Create a tar file of all the files in the current directory:
tar cvf myfile.tar *
or put it in a different directory:
 tar cvf $HOME/myfile.tar *
To extract myfile.tar to the current directory
tar xvf myfile.tar 
To a specific directory:
tar xvf myfile.tar -C mydir

No comments:

Post a Comment