LIST FILES WITHIN GZIP
How to list the files within a compressed
gzip file without extracting it and get information like the timestamp and permissions?
To achieve this, we can use a tool called
Looking to its help session we can see:
The option we need is
-l to list compressed file contents.
This will output a list of all the files and directories in the compressed file, along with some information.
For example, if you have a compressed file called
file_sample.gz, you can run the following command to list its contents:
This will output something like the following:
This tells us that the compressed file contains several files, and list information like file permission, file ownership, size and timestamp.
zcat is very useful for several situations. This short article is a small introduction, always check the package
man pages or the online documentation for more broad knowledge.