More from ‘less’
January 30, 2009 by Clair Ching
Filed under General
I learned something new today about the less command:
When you need to look at the contents of the tar.gz file you downloaded, you could actually use the command less to list them for you!
$ less yourfile.tar.gz

Image credit: Clair Ching, 2009. Screenshot posted on Flickr.
This is a sample of the output of the less command. You don’t have to extract the file’s contents before you could check if all the files you are expecting to be there.
This is thanks to the article on ServerWatch
It’s called Reading Compressed Files with Less.
Another tip I got from the article is that you could list contents of .gz files with zless instead of less. There are other useful commands in the article and maybe you’d be able to use them depending on what your needs are. If you’re not using a GUI environment you already have a tool for listing files.
I have to admit using the desktop environments and window managers like GNOME and OpenBox more so I’ve been relying on the tools available with them.
















