cli-tarHow do I create a gzip tar archive?
Creating a gzip tar archive is a straightforward process. The following example code creates a tar archive of the current directory, compresses it with gzip, and names it "myarchive.tar.gz":
tar -czf myarchive.tar.gz .
This command has several parts:
tar
: the tar command to create an archive-czf
: the flags for creating a gzip compressed tar archivemyarchive.tar.gz
: the name of the resulting archive.
: the directory to be archived
The output of this command will be something like this:
$ tar -czf myarchive.tar.gz .
$
For more information about creating tar archives with gzip, see the GNU tar manual.
More of Cli Tar
- How do I use the command line to tar and zip files?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and distribute files?
- How can I use tar commands to zip a file?
- How do I use the Unix tar zip command?
- How do I use the command line to tar and zip a file?
- How do I use the Unix tar xvf command to extract files?
- How do I create a tar.zip file in Unix?
- How do I use the command line to tar and zip a file?
- How do I use gzip, tar, and zip to compress files?
See more codes...