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 do I use the Unix tar zip command?
- How do I use the Unix tar xzvf command?
- How do I use the Unix tar xvf command to extract files?
- How do I use gzip with tar?
- How do I use gzip to compress a tar file on Windows?
- How can I use the CLI to yield a tar file?
- How can I use gzip to compress a file without using tar?
- How can I decide between using tar gzip and bzip2 for compressing files?
- How do I use the shell to tar and zip files?
- How do I use tar commands with xz?
See more codes...