cli-tarHow do I tar gzip a directory?
To tar gzip a directory, use the tar
command with -z
and -c
flags.
tar -zcvf <name_of_archive>.tar.gz <name_of_directory>
This will create a tar.gz
archive with the contents of the specified directory.
The flags used are:
-z
: Compress the resulting archive with gzip.-c
: Create a new archive.-v
: Verbosely list files which are processed.-f
: Specify the filename of the archive.
Helpful links
More of Cli Tar
- How do I use the Unix tar zip command?
- How do I use the command line to tar and zip files?
- 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 create a tar.zip file in Unix?
- How do I use the command line to tar and distribute files?
- How do I use the command line to tar and zip a file?
- How do I compare Unix tar and zip files?
- How do I use gzip, tar, and zip to compress files?
See more codes...