cli-tarHow do I use the Unix tar command to compress a folder?
The Unix tar command is used to compress a folder by creating a tarball (a tar archive file). To use the tar command, open the command line and type:
tar -cvf <filename>.tar <foldername>
This command will create a tar archive file named
The parts of the command are as follows:
tar
- the command to create an archive-cvf
- the flags used to create the archive-c
- create a new archive-v
- verbose output (optional)-f
- specify the filename of the archive
<filename>.tar
- the name of the archive to be created<foldername>
- the name of the folder to be compressed
To extract the contents of the archive, use the following command:
tar -xvf <filename>.tar
This command will extract the contents of the
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...