Slowing Down the Listing and Reading Files with the Less Command
The problem with
ls is that it can deluge you with information that flies past your eyes faster than you can see it. If you use the LX Terminal from the desktop environment, you can use a scrollbar to review information that has scrolled off the screen.
The more usual solution, however, is to use a command called
less, which takes your listing and enables you to page through it, one screen at a time. To send the listing to the
less command, you use a pipe character after your listing command, like this:
ls | less
When you’re using
less, you can move through the listing one line at a time using the up and down cursor keys, or one page at a time using the Page Up (or b) and Page Down (or space) keys. You can search by pressing
/ and then typing what you’d like to search for and pressing Enter. When you’ve finished, press the Q key (upper- or lowercase) to quit.
You can also use
less to view the contents of a text file by giving it the filename as an argument, like this:
This is a great way to read files you find as you explore Linux. The
less command warns you if the file you want to read might be a binary file, which means it’s computer code and likely to be unintelligible, so you can try using the
less command ...