cli-tarHow do I list the files contained in a Unix tar archive?
To list the files contained in a Unix tar archive, the tar
command can be used. This command has the -tvf
flags, which stands for "list verbosely, the contents of an archive file". An example of this command is shown below:
tar -tvf archive.tar
This command will produce an output similar to this:
-rw-r--r-- user/group 0 2020-07-20 11:55 file1.txt
-rw-r--r-- user/group 0 2020-07-20 11:55 file2.txt
-rw-r--r-- user/group 0 2020-07-20 11:55 file3.txt
The output of this command will list each file contained in the tar archive, including the file's size, date, and permissions.
The command used is composed of the following parts:
tar
: the command to list the contents of a tar archive-tvf
: the flags to list the contents of an archive file verboselyarchive.tar
: the name of the tar archive
For more information, please refer to the following links:
More of Cli Tar
- How do I use the command line to tar and zip files?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and distribute 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 zip a file?
- How do I use the Unix tar xvf command to extract files?
- 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 gzip, tar, and zip to compress files?
See more codes...