|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
| News | Recommended Books | Recommended Links | Reference | mv command | |
| tar | cpio | Admin Horror Stories | Unix History | Humor |
Etc |
less is a once public domain, now GNU replacement for more. The original version appeared in the old net.sources pre-Usenet group way back in 1985.
By default, less works just like more. You give it the name of a file to look at, or pipe a command's output to it, and it displays one screen's worth of the stuff and waits for you to hit the spacebar before showing the next screen:
The most noticable difference is that less doesn't automatically quit when it reaches the end of a file unlike more. When you reach the end of the file (or pipe), type "q" to quit. You can override this behavior by putting the "-e" option in the LESS environment variable:% less .login % ypcat -k aliases | lessOnce inside of less, you can move up and down in the file using either vi(1) or emacs(1) motion controls. You can search for a string using the standard vi method of /pattern to search forward for pattern or ?pattern to search backwards. "n" finds the next match in the same direction, "N" in the opposite direction. Search matches are highlighted by default.% setenv LESS -eless has lots of other gewgaws and doodads for doing fancy stuff. Consult the man page for details, or read the online help by typing "h" inside less.
If you decide you like less and want to use it as your default pager instead of more, set the PAGER environment variable to less:
Then things like man(1) will use less instead of more.% setenv PAGER less
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: February 07, 2010