Site icon Freshershome

How to tar and Untar files in unix

To Tar Files of a directory and sub directories recursively:

tar cvzf foo.tgz freshershome

Will tar the directory freshershome (and its files/subdirectories) into a tar file named foo.tgz.

To extract gzip-1.2.4.tar and compile the sources on Unix systems, do:
tar xvf freshershome.tar
Or
tar -xzvf freshershome.tar.gz
Above will extract freshershome.tar.gz:
Will work on .tar.gz (or .tgz). Take out the ‘z’ for a plain .tar. Replace it with a ‘j’ for .tar.bz. Run ‘man tar’ for more complete instructions on using tar.

Exit mobile version