Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown    



THE COMMAND LESS


If the ¨cat¨ command shows you the contents of a file, it does often happen that the file is to long for your screen. ¨piping¨ it through ¨less¨ makes it appear on your sceen page by page.

An example: ( you have to be root to read the log-messages )

CODE
$ cat /var/log/messages


The output is un-readable because it flashes over the screen

CODE
$ cat /var/log/messages | less


( the ¨|¨ pipe-sign is the character on the key between ¨backspace¨ and ¨enter¨ )
Shows the file one page at a time.

Also you can also do a search in less: press the ¨?/¨ key, type the word to look for and hit Enter. It will mark all the matching entries in a different color.
Shift + ¨?/¨ will search backwards.

¨80G¨ will put you on line 80 of the file.

You change page with the spacebar and close off with ¨q¨

No more to say about ¨less¨, exept that it does more or less the same as ¨more¨.

*( ¨more¨ is another command, but is not as effective as ¨less¨ )


Bruno


-- Jun 18 2003 ( Revised Dec 10 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown