home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 25.3 Using more to Page Through Files Chapter 25
Showing What's in a File
Next: 25.5 Page Through Compressed, RCS, Unprintable Files
 

25.4 The "less" Pager: More than "more"

less
less is one of those classic file-listing programs, like list on MS-DOS, that does so much you never realized you needed to do. It does so much more than more (25.3 ) , and does it so much better, that it's one of the first programs I port to a new computer. If I tried to cover all the features, this article would be ten pages long. Luckily, less comes with online help (type h ) and a comprehensive manual page, which is stored with the software on the disc.

Some of the features and advantages:

  • No relearning: less does the right thing when you use more , vi (30.2 ) , or emacs (32.1 ) file-browsing commands.

  • While reading from pipes (1.3 ) , less can redraw the screen and read previous pages.

  • Lots of ways to move to certain parts of the file: by line number, percentage, screen, with a search. Can mark and return to lines.

  • For programmers: handles nonstandard tabstops (41.4 ) . Finds matching braces and parentheses.

  • An incredible number of screen-control settings and options to make the screen look like you want it, including position after searches. Customizable prompt to give you the information you want.

The lesskey program (which is included with the less distribution on the disc) lets you make custom key definitions. You can store your favorite setup options in the LESS environment variable (6.1 ) .

- JP , TOR


Previous: 25.3 Using more to Page Through Files UNIX Power Tools Next: 25.5 Page Through Compressed, RCS, Unprintable Files
25.3 Using more to Page Through Files Book Index 25.5 Page Through Compressed, RCS, Unprintable Files

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System