|
| 1 | +.TH LESS 1 |
| 2 | +.SH NAME |
| 3 | +less |
| 4 | +\- display pager |
| 5 | +.SH SYNOPSIS |
| 6 | +.B less |
| 7 | +[file] |
| 8 | +.SH DESCRIPTION |
| 9 | +.I Less |
| 10 | +is a small and memory-efficient subset of the normal Unix |
| 11 | +.IR less(1) |
| 12 | +pager. It displays either the text file named on the command line, |
| 13 | +or standard input if there is no command-line argument. The input |
| 14 | +is displayed one screen at a time, and the user can scroll backwards |
| 15 | +and forwards through the input using these commands: |
| 16 | +.RS |
| 17 | +.TP |
| 18 | +.B f or <space> |
| 19 | +Move forward one screen |
| 20 | +.TP |
| 21 | +.B b |
| 22 | +Move backwards one screen |
| 23 | +.TP |
| 24 | +.B d |
| 25 | +Move forward half a screen |
| 26 | +.TP |
| 27 | +.B u |
| 28 | +Move backwards half a screen |
| 29 | +.TP |
| 30 | +.B j or <return> |
| 31 | +Move forward a line |
| 32 | +.TP |
| 33 | +.B k |
| 34 | +Move backwards a line |
| 35 | +.TP |
| 36 | +.B g |
| 37 | +Move to the start of the input |
| 38 | +.TP |
| 39 | +.B q |
| 40 | +Exit the program |
| 41 | +.RE |
| 42 | +.PP |
| 43 | +.IR less(1) |
| 44 | +will interpret sequences in the input such as x<backspace>x and |
| 45 | +display them in bold using ANSI escape sequences. Similarly, |
| 46 | +input sequences such as x<backspace>_ will be displayed underlined. |
| 47 | +.PP |
| 48 | +When using standard input, |
| 49 | +.IR less(1) |
| 50 | +buffers the input in a temporary file which is immediately unlinked |
| 51 | +so that it does not persist after the program exits. |
| 52 | +.SH SEE ALSO |
| 53 | +.IR more(1) |
| 54 | +.SH DIAGNOSTICS |
| 55 | +.IR less(1) |
| 56 | +normally exits with a zero value unless something goes wrong, when it will |
| 57 | +exit with value 1. These diagnostic messages may be issued: |
| 58 | +.RS |
| 59 | +.TP |
| 60 | +.B Unable to open <filename> |
| 61 | +The file named on the command line does not exist. |
| 62 | +.TP |
| 63 | +.B Cannot tc[gs]etattr |
| 64 | +The terminal cannot be put into cbreak mode. |
| 65 | +.TP |
| 66 | +.B fseek error in <function> |
| 67 | +.IR less(1) |
| 68 | +tried to move to a position in the input file which is not there. |
| 69 | +.TP |
| 70 | +.B Unable to open /dev/tty |
| 71 | +The character device /dev/tty does not exist: |
| 72 | +.IR less(1) |
| 73 | +needs to open this to set it to cbreak mode. |
| 74 | +.TP |
| 75 | +.B [mc]alloc error in <function> |
| 76 | +The program ran out of memory, even after freeing some memory. |
| 77 | +.RE |
| 78 | +.SH BUGS AND LIMITTATIONS |
| 79 | +.IR less(1) |
| 80 | +caches the file offsets for each line in memory. As you page down through |
| 81 | +a big file, |
| 82 | +.IR less(1) |
| 83 | +may run out of memory to hold all the offsets. When this happens, offsets |
| 84 | +from the beginning of the file are freed. This implies that you may not |
| 85 | +be able to page back to the top of the file. |
0 commit comments