cli-tarHow do I use the tar command line tool on Linux?
The tar
command line tool on Linux is used to create, extract, and manipulate files that are archived in the tar format.
The basic syntax for the tar
command is: tar [options] [archive] [files]
.
Here is an example of how to use the tar
command to create an archive:
tar -cvf archive.tar file1 file2
This command will create an archive named archive.tar
containing the files file1
and file2
.
To extract files from an archive, use the -x
option, like this:
tar -xvf archive.tar
This command will extract the contents of archive.tar
into the current directory.
The tar
command also has options to add files to an existing archive, list the contents of an archive, and more. For more information, see the man page for tar
or the following links:
More of Cli Tar
- How do I use the command line to tar and zip files?
- 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 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 distribute files?
- 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 create a tar.zip file in Unix?
- How do I use the command line to tar and zip a file?
See more codes...