Thursday, 5 October 2017

How to Compress an Entire Directory or a Single File in Linux



Compress an entire directory or a single file on Linux. It will also compress every other directory inside a directory recursively.


[root@linuxcnf ~]# tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

Used options details in the above command:

-c: To create an archive.
-z: To compress the archive with gzip.
-v: Display progress status in the terminal while creating the archive.
-f: Allows you to specify the filename of the archive.

No comments:

Post a Comment