One Day One Cmd

Place for playing with commands…

Day 70: $ Creating a tar file

ODOC:Note: A “.tar” file is not a compressed files, it is a collection of files within a single file uncompressed. If the file is a .tar.gz (“tarball”) or “.tgz” file it is a collection of files that is compressed. If you are looking to compress a file you would create the tar file then gzip the file.

Creating a tar file:

praveen@praveen-desktop:~$tar -cvwf file.tar myfile.txt

In this example the system would create a tar named file.tar in the directory you currently are in.

for example:

praveen@praveen-desktop:~$tar -cvwf file.tar *.txt

It would compress all txt files in the current directory.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: