Saturday, September 23, 2023
422
rated 0 times [  422] [ 0]  / answers: 1 / hits: 732273  / 1 Year ago, mon, october 3, 2022, 1:14:33

I want to see the contents (list of files and folders) of an archive, for example a tar.gz file without extracting it.



Are there any methods for doing that?


More From » command-line

 Answers
1

Run the below command in the terminal to see the contents of a tar.gz file without extracting it:


tar -tf filename.tar.gz

screenshot of listing compressed tarball files in the terminal



-t, --list

List the contents of an archive. Arguments are optional. When given, they specify the names of the members to list.




-f, --file=ARCHIVE
Use archive file or device ARCHIVE...



[#27914] Wednesday, October 5, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fulerio

Total Points: 172
Total Questions: 124
Total Answers: 109

Location: Hungary
Member since Thu, Aug 6, 2020
3 Years ago
;