cli-tarHow do I tar a folder using the command line?
Tar is a command line utility used to create and manipulate archive files. To tar a folder using the command line, use the following command:
tar -czvf <name_of_archive_file>.tar.gz <name_of_folder>
This command will create a tar.gz archive file of the specified folder. The options used are:
-c
: Create an archive.-z
: Compress the archive with gzip.-v
: Verbosely list files which are processed.-f
: Allows you to specify the filename of the archive.
For example, if you wanted to create an archive of the folder my_folder
and name it my_archive.tar.gz
, you would use the following command:
tar -czvf my_archive.tar.gz my_folder
The output of this command will be a list of the files which are being archived.
For more information on the tar command, see the GNU Tar Manual.
More of Cli Tar
- How do I use the Unix tar zip command?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and zip a file?
- How do I use gzip, tar, and zip to compress files?
- 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 distribute files?
- How do I create a tar.zip file in Unix?
- How do I use the Unix tar xvf command to extract files?
- How do I use the command line to tar and zip a file?
See more codes...