less [options] [filename]

less is a program for paging through files or other output. It was written in reaction to the perceived primitiveness of more (hence its name). Some commands may be preceded by a number.


-[z] num

Set number of lines to scroll to num. Default is one screenful. A negative num sets the number to num lines less than the current number.

+[+] command

Run command on startup. If command is a number, jump to that line. The option ++ applies this command to each file in the command-line list.


Print help screen. Ignore all other options; do not page through file.


When searching, begin after last line displayed. (Default is to search from second line displayed.)

-b buffers

Use buffers buffers for each file (default is 10). Buffers are 1 kilobyte in size.


Redraw screen from top, not bottom.


Suppress dumb-terminal error messages.


Automatically exit after reaching EOF twice.


Force opening of directories and devices; do not print warning when opening binaries.


Highlight only string found by past search command, not all matching strings.

-h num

Never scroll backward more than num lines at once.


Make searches case-insensitive, unless the search string contains uppercase letters.

-j num

Position target line on line num of screen. Target line can be the result of a search or a jump. Count lines beginning from 1 (top line). A negative num is counted back from bottom of screen.

-k file

Read file to define special key ...

Get Mac OS X in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.