cli-tarHow do I compress a folder using tar and gz in the command line?
The tar command can be used to compress a folder in the command line. The gz option is used to compress the folder with the gzip algorithm.
To compress a folder using tar and gz, use the following command:
tar -czvf <output-filename>.tar.gz <input-folder>
The flags used in this command are:
-c: create a new archive-z: compress the archive withgzip-v: verbose mode - show the progress while creating the archive-f: specify the filename of the archive
The output of this command will be a single tar.gz file containing the compressed folder.
Helpful links
More of Cli Tar
- How do I use the command line to create a tar file?
- How do I use the tar command on Windows?
- How do I use the command line to tar and zip a file?
- How do I use the Unix tar xzvf command?
- How do I use tar gzip with a password?
- How do I use the Unix tar xvf command to extract files?
- How to use tar shell to integrate with Vipps?
- How do I use gzip and tar in Linux?
- How do I compress a file using gzip and tar.xz?
- How do I use the command line to tar and zip files?
See more codes...