Home Explore Blog CI



man-pages

12th chunk of `less.man`
f2fd413d8ef42b4bf721b6a031cb578aff6dff742ccaeb690000000100000fb6
 (see the INPUT PREPROCESSOR section below).  This option can be set from within less, but it will apply only to files opened subsequently, not to the file which is cur‐
              rently open.

       -m or --long‐prompt
              Causes less to prompt verbosely (like more), with the percent into the file.  By default, less prompts with a colon.

       -M or --LONG‐PROMPT
              Causes less to prompt even more verbosely than more.

       -n or --line‐numbers
              Suppresses line numbers.  The default (to use line numbers) may cause less to run more slowly in some cases, especially with a very large input file.  Suppressing line numbers with the -n option will avoid this
              problem.  Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also  the  discussion  of
              LESSEDIT in PROMPTS below).

       -N or --LINE‐NUMBERS
              Causes a line number to be displayed at the beginning of each line in the display.

       -ofilename or --log‐file=filename
              Causes  less to copy its input to the named file as it is being viewed.  This applies only when the input file is a pipe, not an ordinary file.  If the file already exists, less will ask for confirmation before
              overwriting it.

       -Ofilename or --LOG‐FILE=filename
              The -O option is like -o, but it will overwrite an existing file without asking for confirmation.

              If no log file has been specified, the -o and -O options can be used from within less to specify a log file.  Without a file name, they will simply report the name of the log file.  The "s" command  is  equiva‐
              lent to specifying -o from within less.

       -ppattern or --pattern=pattern
              The -p option on the command line is equivalent to specifying +/pattern; that is, it tells less to start at the first occurrence of pattern in the file.

       -Pprompt or --prompt=prompt
              Provides  a  way to tailor the three prompt styles to your own preference.  This option would normally be put in the LESS environment variable, rather than being typed in with each less command.  Such an option
              must either be the last option in the LESS variable, or be terminated by a dollar sign.
               -Ps followed by a string changes the default (short) prompt to that string.
               -Pm changes the medium (-m) prompt.
               -PM changes the long (-M) prompt.
               -Ph changes the prompt for the help screen.
               -P= changes the message printed by the = command.
               -Pw changes the message printed while waiting for data (in the F command).

              All prompt strings consist of a sequence of letters and special escape sequences.  See the section on PROMPTS for more details.

       -q or --quiet or --silent
              Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file.  If the terminal has a "visual bell", it is  used
              instead.  The bell will be rung on certain other errors, such as typing an invalid character.  The default is to ring the terminal bell in all such cases.

       -Q or --QUIET or --SILENT
              Causes totally "quiet" operation: the terminal bell is never rung.  If the terminal has a "visual bell", it is used in all cases where the terminal bell would have been rung.

       -r or --raw‐control‐chars
              Causes  "raw"  control characters to be displayed.  The default is to display control characters using the caret notation; for example, a control‐A (octal 001) is displayed as "^A".  Warning: when the -r option
              is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type

Title: Less Command Options: Prompts, Line Numbers, Logging, Pattern Search, and Quiet Mode
Summary
This section details more command-line options for `less`, including controlling prompt verbosity with short, medium and long prompts and displaying line numbers. It also covers options for logging output to a file (-o, -O), starting at a specific pattern (-p), customizing prompt styles (-P), controlling terminal bell behavior (-q, -Q), and displaying raw control characters (-r).