cli-tarHow do I use the command line to tar a directory?
The command line utility tar
is used to create and manipulate tarball archives. To tar a directory, the following command can be used:
tar -cvf <archive_name>.tar <directory_name>
This command will create a tarball archive named <archive_name>.tar
from the directory <directory_name>
.
The following parts are used in the command:
tar
- the command line utility used to create and manipulate tarball archives-cvf
- flags used to create a tarball archive<archive_name>.tar
- the name of the tarball archive to create<directory_name>
- the name of the directory to tar
The output of the command will be the list of files that were added to the tarball archive.
Helpful links
More of Cli Tar
- How do I use gzip, tar, and zip to compress files?
- How do I use the command line to tar and zip a file?
- 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 Unix tar zip command?
- 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 the command line to tar and distribute files?
- How do I use the Unix tar xvf command to extract files?
- How do I use the shell to tar and zip files?
See more codes...