The Fast Way to Read Compressed Files on Linux
Read Compressed Files Without Unpacking
zless can't, however, handle files that have been tarred as well as zipped. Here's an alternative command line that will allow you to page through file.tar.gz without unpacking it beforehand and thus without leaving unzipped files lying around:
tar --to-stdout -zxf file.tar.gz | less
export LESSOPEN="|tar --to-stdout -zxf %s"
In fact, this will deal with both uncompressed files and piped input as well, so you can set this variable in your .bashrc. However, it won't work on plain .gz files ��� for those, you should still use zless.
One last note: If you regularly want to look at tar archives that aren't also zipped (e.g., file.tar), you can set export LESSOPEN="|tar --to-stdout -xf %s" to work the same trick for these files.
Article courtesy of Serverwatch
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 2Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 3Linux Top 3: Debian Dumps SPARC, Ubuntu Takes Over Linux 3.13 and the Core Infrastructure Initiative
- 4Linux Top 3: Fedora, Ubuntu and Gluster Lose Community Leaders
- 5Red Hat Enterprise Linux 7 Finally Hits the Big Time