- Less (Unix)
Infobox Software
name = Less
caption = Less output in a x-terminal
developer = Mark Nudelman
latest_release_version = 418
latest_release_date = 2 January 2008
operating_system =Cross-platform
genre = system utility
license = dual: either GPL or BSD-like License
website = [http://www.greenwoodsoftware.com/less/ www.greenwoodsoftware.com/less/]less is a
terminal pager program onUnix , Windows andUnix-like systems used to view (but not change) the contents of atext file one screen at a time. It is similar to more, but has the extended capability of allowing both forward and backward navigation through the file. Unlike most Unix text editors/viewers, less does not need to read the entire file before starting, resulting in faster load times with large files.History
less was initially written by
Mark Nudelman during 1983-85, in the need of a version of more able to do backward scrolling of the displayed text. The name came from the joke of doing "backwards more".less is now part of theGNU project and it is included in most Unix systems.Usage
less can be invoked with options to change its behaviour, for example, the number of lines to display on the screen. A few options vary depending on the operating system. While less is displaying the file, various commands can be used to navigate through the file. These commands are based on those used by both more and
vi . It is also possible to search for character patterns in the file.By default, less displays the contents of the file to the
standard output (one screen at a time). If the file name argument is omitted, it displays the contents fromstandard input (usually the output of another command through a pipe). If the output is redirected to anything other than a terminal, for example a pipe to another command, less behaves like cat.The command-
syntax is:less " [options] " "file_name"
Frequently used options
*
-g
: Highlights just the current match of any searched string.
*-I
: Case-insensitive searches.
*-M
: Shows more detailed prompt, including file position.
*-N
: Shows line numbers (useful forsource code viewing).
*-S
: Disables line wrap ("chop long lines"). Long lines can be seen by side scrolling.
*-?
: Shows help.Frequently used commands
* [Arrows] / [Page Up] / [Page Down] / [Home] / [End] : Navigation.
* [Space bar] : Next page.
*b: Previous page.
*"n"g: Jump to line number "n". Default is the start of the file.
*"n"G: Jump to line number "n". Default is the end of the file.
*/"pattern": Search for "pattern".Regular expression s can be used.
*n: Go to next match (after a successful search).
*N: Go to previous match.
*m"letter": Mark the current position with "letter".
*' "letter": Return to position "letter". [' = single quote]
*'^ or g: Go to start of file.
*'$ or G: Go to end of file.
*s: Save current content (got from another program likegrep ) in a file.
*=: File information.
*F: continually read information from file and follow its end. Useful for logs watching. Use Ctrl+C to exit this mode.
*-"option": Toggle command-line option -"option".
*h: Help.
*q: Quit.Examples
External links
* [http://www.greenwoodsoftware.com/less/ Official home page]
* [http://www.linuxmanpages.com/man1/less.1.php manpage for less]Variations of less
* [http://aqualess.sourceforge.net/ AquaLess] for
Mac OS X
Wikimedia Foundation. 2010.