How to use the tar command?

The tar command is used for bundling multiple files and folders.  It is similar to the zip command although the files don’t have to be compressed. The ‘.gz’ extension highlights if the tar file is compressed.

Many of the packages you will want to install on Linux distributions will be packaged in a .tar.gz file.  To extract it run the below command.

tar –xvzf filename.tar.gz

c – create a archive file.
x – extract a archive file.
v – show the progress of archive file.
f – filename of archive file.
t – viewing content of archive file.
j – filter archive through bzip2.
z – filter archive through gzip.
r – append or update files or directories to existing archive file.
W – Verify a archive file.
wildcards – Specify patters in unix tar command.

Leave a Reply

Your email address will not be published. Required fields are marked *

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