The below command will create a tar archive file whatevername_yougive.tar for a directory /path/of/directory/to/archive in current working directory.

See the example below.

tar cvf whatevername_yougive.tar /path/of/directory/to/archive

The options detail are explained as below
c – Creates a new .tar archive file.
v – Verbosely show the .tar file progress.
f – File name type of the archive file.

Similarly to create tar.gz file

tar cvzf whatevername_yougive.tar.gz /path/of/directory/to/archive

To untar or uncompress a tar file check here

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.