cli-tarHow do I tar and gzip a folder in Linux?
The tar
command is a great way to compress a folder in Linux. It creates a single file that contains all of the files and folders inside the folder you specified. To tar and gzip a folder in Linux, you can use the following command:
tar -zcvf <filename>.tar.gz <folder_name>
This will create a <filename>.tar.gz
file that contains the contents of the <folder_name>
.
The parts of the command are as follows:
tar
: The command to create the archive-zcvf
: The flags used to create a gzipped tar archive<filename>.tar.gz
: The name of the archive file to be created<folder_name>
: The name of the folder to be compressed
For more information, see the GNU tar documentation.
More of Cli Tar
- How can I use tar commands to zip a file?
- How do I use the command line to tar and zip a file?
- How do I use the shell to tar and zip files?
- How do I use the Unix tar zip command?
- How do I create a tar.zip file in Unix?
- How do I use the command line to tar and zip files?
- How do I use gzip, tar, and zip to compress files?
- 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 the command line to tar and zip a file?
See more codes...