O'Reilly logo

Mac OS X in a Nutshell by Chris Stone, Chuck Toporek, Jason McIntosh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required