Breaking News
Home / Sys Admin / Unix / How to view a gzipped file without extracting it?

How to view a gzipped file without extracting it?

Gzipped FileLet’s say we have a compressed file in the gzip format and we want to view the content of the file, search a string within in etc. as if it was not a compressed file at all.

One way ofcourse would be gunzip it and then view the contents with less command at the shell prompt, but this approach has 2 disadvantages

1 – It take time to gunzip the file, view the contents and gzip again once done

2 – At times depending on the size of zipped file and the space available on the harddrive unzip the file may not be an option.

Thanks to unix pipes here is how you do it

gunzip -c filename.gz | less -ni

 Then you can view or search the file contents as if its already extracted.


Check Also

How to list disks information in Linux?

In order to check the disk in the system we can use the List Hardware …

Advertisment ad adsense adlogger