TAR Command with examples

TAR is archiving utility in Linux. With tar command, multiple files and directories can be archived into a single file, with extension of that file is ".tar".

"gzip" and "bzip" compression techniques can be used with tar command.

Syntax:

$ tar [options] [desired tar file name] [list of file and/or directories]
Examples for your reference

I need to create a tar file named umasarath from the directory_name folder. Below is the basic command to create a tar archive.

$ tar cvf umasarath.tar directory_name/
Here cvf stands for 
c - create new archive file
v - verbosely list files
f - following is archive file name.


The above example tar cvf option, does not provide any compression. Inorder to use a gzip compression on the tar archive, use the z option as shown below.

$ tar cvzf umasarath.tar directory_name/

Here z stands for 
z - filter the archive through gzip

Please Note: .tgz is same as .tar.gz









Comments

Popular posts from this blog

[SOLVED] - RSYNC not executing via CRON

RSYNC command without authentication - 8 simple steps

Install JDK on Ubuntu