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: Alienware, KDE and Ubuntu 13.04
- 2Linux Top 3: Linux Mint Olivia, Fedora 19's Cat and Ubuntu's Mission Accomplished Moment
- 3GNOME 3.8 Debuts New Open Source Linux Desktop
- 4Linux Top 3: Linux 3.10 Goes Long, Linux 3.11 Advances as LXDE Merges
- 5Linux Top 3: Ubuntu Kaylin, Debian Wheezy and Linux Mint