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 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...