Name

less

Synopsis

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.

Options

-[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.

-a

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.

-c

Redraw screen from top, not bottom.

-d

Suppress dumb-terminal error messages.

-e

Automatically exit after reaching EOF twice.

-f

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

-g

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

-h num

Never scroll backward more than num lines at once.

-i

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.