Penguin
Annotated edit history of pager(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 LESS
2 !!!LESS
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 COMMANDS
7 OPTIONS
8 LINE EDITING
9 KEY BINDINGS
10 INPUT PREPROCESSOR
11 NATIONAL CHARACTER SETS
12 PROMPTS
13 SECURITY
14 ENVIRONMENT VARIABLES
15 SEE ALSO
16 WARNINGS
17 COPYRIGHT
18 AUTHOR
19 ----
20 !!NAME
21
22
23 less - opposite of more
24 !!SYNOPSIS
25
26
27 __less -?
28 less --help
29 less -V
30 less --version
31 less [[-[[+]aBcCdeEfFgGiIJmMnNqQrRsSuUVwWX]
32 [[-b__ ''space''__] [[-h__ ''lines''__] [[-j__
33 ''line''__] [[-k__ ''keyfile''__]
34 [[-{oO}__ ''logfile''__] [[-p__ ''pattern''__]
35 [[-P__ ''prompt''__] [[-t__ ''tag''__]
36 [[-T__ ''tagsfile''__] [[-x__ ''tab''__,...]
37 [[-y__ ''lines''__] [[-[[z]__ ''lines''__]
38 [[+[[+]__''cmd''__] [[--]
39 [[__''filename''__]...__
40 (See the OPTIONS section for alternate option syntax with
41 long option names.)
42 !!DESCRIPTION
43
44
45 ''Less'' is a program similar to ''more'' (1), but
46 which allows backward movement in the file as well as
47 forward movement. Also, ''less'' does not have to read
48 the entire input file before starting, so with large input
49 files it starts up faster than text editors like ''vi''
50 (1). ''Less'' uses termcap (or terminfo on some systems),
51 so it can run on a variety of terminals. There is even
52 limited support for hardcopy terminals. (On a hardcopy
53 terminal, lines which should be printed at the top of the
54 screen are prefixed with a caret.)
55
56
57 Commands are based on both ''more'' and ''vi.''
58 Commands may be preceded by a decimal number, called N in
59 the descriptions below. The number is used by some commands,
60 as indicated.
61 !!COMMANDS
62
63
64 In the following descriptions, ^X means control-X. ESC
65 stands for the ESCAPE key; for example ESC-v means the two
66 character sequence
67
68
69 h or H
70
71
72 Help: display a summary of these commands. If you forget all
73 the other commands, remember this one.
74
75
76 SPACE or ^V or f or ^F
77
78
79 Scroll forward N lines, default one window (see option -z
80 below). If N is more than the screen size, only the final
81 screenful is displayed. Warning: some systems use ^V as a
82 special literalization character.
83
84
85 z
86
87
88 Like SPACE, but if N is specified, it becomes the new window
89 size.
90
91
92 ESC-SPACE
93
94
95 Like SPACE, but scrolls a full screenful, even if it reaches
96 end-of-file in the process.
97
98
99 RETURN or ^N or e or ^E or j or ^J
100
101
102 Scroll forward N lines, default 1. The entire N lines are
103 displayed, even if N is more than the screen
104 size.
105
106
107 d or ^D
108
109
110 Scroll forward N lines, default one half of the screen size.
111 If N is specified, it becomes the new default for subsequent
112 d and u commands.
113
114
115 b or ^B or ESC-v
116
117
118 Scroll backward N lines, default one window (see option -z
119 below). If N is more than the screen size, only the final
120 screenful is displayed.
121
122
123 w
124
125
126 Like ESC-v, but if N is specified, it becomes the new window
127 size.
128
129
130 y or ^Y or ^P or k or ^K
131
132
133 Scroll backward N lines, default 1. The entire N lines are
134 displayed, even if N is more than the screen size. Warning:
135 some systems use ^Y as a special job control
136 character.
137
138
139 u or ^U
140
141
142 Scroll backward N lines, default one half of the screen
143 size. If N is specified, it becomes the new default for
144 subsequent d and u commands.
145
146
147 ESC-) or RIGHTARROW
148
149
150 Scroll horizontally right N characters, default half the
151 screen width (see the -# option). If a number N is
152 specified, it becomes the default for future RIGHTARROW and
153 LEFTARROW commands. While the text is scrolled, it acts as
154 though the -S option (chop lines) were in
155 effect.
156
157
158 ESC-( or LEFTARROW
159
160
161 Scroll horizontally left N characters, default half the
162 screen width (see the -# option). If a number N is
163 specified, it becomes the default for future RIGHTARROW and
164 LEFTARROW commands.
165
166
167 r or ^R or ^L
168
169
170 Repaint the screen.
171
172
173 R
174
175
176 Repaint the screen, discarding any buffered input. Useful if
177 the file is changing while it is being viewed.
178
179
180 F
181
182
183 Scroll forward, and keep trying to read when the end of file
184 is reached. Normally this command would be used when already
185 at the end of the file. It is a way to monitor the tail of a
186 file which is growing while it is being viewed. (The
187 behavior is similar to the
188
189
190 g or
191
192
193 Go to line N in the file, default 1 (beginning of file).
194 (Warning: this may be slow if N is large.)
195
196
197 G or
198
199
200 Go to line N in the file, default the end of the file.
201 (Warning: this may be slow if N is large, or if N is not
202 specified and standard input, rather than a file, is being
203 read.)
204
205
206 p or %
207
208
209 Go to a position N percent into the file. N should be
210 between 0 and 100.
211
212
213 {
214
215
216 If a left curly bracket appears in the top line displayed on
217 the screen, the { command will go to the matching right
218 curly bracket. The matching right curly bracket is
219 positioned on the bottom line of the screen. If there is
220 more than one left curly bracket on the top line, a number N
221 may be used to specify the N-th bracket on the
222 line.
223
224
225 }
226
227
228 If a right curly bracket appears in the bottom line
229 displayed on the screen, the } command will go to the
230 matching left curly bracket. The matching left curly bracket
231 is positioned on the top line of the screen. If there is
232 more than one right curly bracket on the top line, a number
233 N may be used to specify the N-th bracket on the
234 line.
235
236
237 (
238
239
240 Like {, but applies to parentheses rather than curly
241 brackets.
242
243
244 )
245
246
247 Like }, but applies to parentheses rather than curly
248 brackets.
249
250
251 [[
252
253
254 Like {, but applies to square brackets rather than curly
255 brackets.
256
257
258 ]
259
260
261 Like }, but applies to square brackets rather than curly
262 brackets.
263
264
265 ESC-^F
266
267
268 Followed by two characters, acts like {, but uses the two
269 characters as open and close brackets, respectively. For
270 example,
271
272
273 ESC-^B
274
275
276 Followed by two characters, acts like }, but uses the two
277 characters as open and close brackets, respectively. For
278 example,
279
280
281 m
282
283
284 Followed by any lowercase letter, marks the current position
285 with that letter.
286
287
288 '
289
290
291 (Single quote.) Followed by any lowercase letter, returns to
292 the position which was previously marked with that letter.
293 Followed by another single quote, returns to the position at
294 which the last
295
296
297 ^X^X
298
299
300 Same as single quote.
301
302
303 /pattern
304
305
306 Search forward in the file for the N-th line containing the
307 pattern. N defaults to 1. The pattern is a regular
308 expression, as recognized by ''ed.'' The search starts at
309 the second line displayed (but see the -a and -j options,
310 which change this).
311
312
313 Certain characters are special if entered at the beginning
314 of the pattern; they modify the type of search rather than
315 become part of the pattern:
316
317
318 ^N or !
319
320
321 Search for lines which do NOT match the
322 pattern.
323
324
325 ^E or *
326
327
328 Search multiple files. That is, if the search reaches the
329 END of the current file without finding a match, the search
330 continues in the next file in the command line
331 list.
332
333
334 ^F or @
335
336
337 Begin the search at the first line of the FIRST file in the
338 command line list, regardless of what is currently displayed
339 on the screen or the settings of the -a or -j
340 options.
341
342
343 ^K
344
345
346 Highlight any text which matches the pattern on the current
347 screen, but don't move to the first match (KEEP current
348 position).
349
350
351 ^R
352
353
354 Don't interpret regular expression metacharacters; that is,
355 do a simple textual comparison.
356
357
358 ?pattern
359
360
361 Search backward in the file for the N-th line containing the
362 pattern. The search starts at the line immediately before
363 the top line displayed.
364
365
366 Certain characters are special as in the /
367 command:
368
369
370 ^N or !
371
372
373 Search for lines which do NOT match the
374 pattern.
375
376
377 ^E or *
378
379
380 Search multiple files. That is, if the search reaches the
381 beginning of the current file without finding a match, the
382 search continues in the previous file in the command line
383 list.
384
385
386 ^F or @
387
388
389 Begin the search at the last line of the last file in the
390 command line list, regardless of what is currently displayed
391 on the screen or the settings of the -a or -j
392 options.
393
394
395 ^K
396
397
398 As in forward searches.
399
400
401 ^R
402
403
404 As in forward searches.
405
406
407 ESC-/pattern
408
409
410 Same as
411
412
413 ESC-?pattern
414
415
416 Same as
417
418
419 n
420
421
422 Repeat previous search, for N-th line containing the last
423 pattern. If the previous search was modified by ^N, the
424 search is made for the N-th line NOT containing the pattern.
425 If the previous search was modified by ^E, the search
426 continues in the next (or previous) file if not satisfied in
427 the current file. If the previous search was modified by ^R,
428 the search is done without using regular expressions. There
429 is no effect if the previous search was modified by ^F or
430 ^K.
431
432
433 N
434
435
436 Repeat previous search, but in the reverse
437 direction.
438
439
440 ESC-n
441
442
443 Repeat previous search, but crossing file boundaries. The
444 effect is as if the previous search were modified by
445 *.
446
447
448 ESC-N
449
450
451 Repeat previous search, but in the reverse direction and
452 crossing file boundaries.
453
454
455 ESC-u
456
457
458 Undo search highlighting. Turn off highlighting of strings
459 matching the current search pattern. If highlighting is
460 already off because of a previous ESC-u command, turn
461 highlighting back on. Any search command will also turn
462 highlighting back on. (Highlighting can also be disabled by
463 toggling the -G option; in that case search commands do not
464 turn highlighting back on.)
465
466
467 :e [[filename]
468
469
470 Examine a new file. If the filename is missing, the
471
472
473 ^X^V or E
474
475
476 Same as :e. Warning: some systems use ^V as a special
477 literalization character. On such systems, you may not be
478 able to use ^V.
479
480
481 :n
482
483
484 Examine the next file (from the list of files given in the
485 command line). If a number N is specified, the N-th next
486 file is examined.
487
488
489 :p
490
491
492 Examine the previous file in the command line list. If a
493 number N is specified, the N-th previous file is
494 examined.
495
496
497 :x
498
499
500 Examine the first file in the command line list. If a number
501 N is specified, the N-th file in the list is
502 examined.
503
504
505 :d
506
507
508 Remove the current file from the list of files.
509
510
511 t
512
513
514 Go to the next tag, if there were more than one matches for
515 the current tag. See the -t option for more details about
516 tags.
517
518
519 T
520
521
522 Go to the previous tag, if there were more than one matches
523 for the current tag.
524
525
526 = or ^G or :f
527
528
529 Prints some information about the file being viewed,
530 including its name and the line number and byte offset of
531 the bottom line being displayed. If possible, it also prints
532 the length of the file, the number of lines in the file and
533 the percent of the file above the last displayed
534 line.
535
536
537 -
538
539
540 Followed by one of the command line option letters (see
541 OPTIONS below), this will change the setting of that option
542 and print a message describing the new setting. If a ^P
543 (CONTROL-P) is entered immediately after the dash, the
544 setting of the option is changed but no message is printed.
545 If the option letter has a numeric value (such as -b or -h),
546 or a string value (such as -P or -t), a new value may be
547 entered after the option letter. If no new value is entered,
548 a message describing the current setting is printed and
549 nothing is changed.
550
551
552 --
553
554
555 Like the - command, but takes a long option name (see
556 OPTIONS below) rather than a single option letter. You must
557 press RETURN after typing the option name. A ^P immediately
558 after the second dash suppresses printing of a message
559 describing the new setting, as in the -
560 command.
561
562
563 -+
564
565
566 Followed by one of the command line option letters this will
567 reset the option to its default setting and print a message
568 describing the new setting. (The X''
569 ''X''
570 ''
571
572
573 --+
574
575
576 Like the -+ command, but takes a long option name rather
577 than a single option letter.
578
579
580 -!
581
582
583 Followed by one of the command line option letters, this
584 will reset the option to the
585
586
587 --!
588
589
590 Like the -! command, but takes a long option name rather
591 than a single option letter.
592
593
594 _
595
596
597 (Underscore.) Followed by one of the command line option
598 letters, this will print a message describing the current
599 setting of that option. The setting of the option is not
600 changed.
601
602
603 __
604
605
606 (Double underscore.) Like the _ (underscore) command, but
607 takes a long option name rather than a single option letter.
608 You must press RETURN after typing the option
609 name.
610
611
612 +cmd
613
614
615 Causes the specified cmd to be executed each time a new file
616 is examined. For example, +G causes ''less'' to initially
617 display each file starting at the end rather than the
618 beginning.
619
620
621 V
622
623
624 Prints the version number of ''less'' being
625 run.
626
627
628 q or Q or :q or :Q or ZZ
629
630
631 Exits ''less.''
632
633
634 The following four commands may or may not be valid,
635 depending on your particular installation.
636
637
638 v
639
640
641 Invokes an editor to edit the current file being viewed. The
642 editor is taken from the environment variable VISUAL if
643 defined, or EDITOR if VISUAL is not defined, or defaults to
644
645
646 ! shell-command
647
648
649 Invokes a shell to run the shell-command given. A percent
650 sign (%) in the command is replaced by the name of the
651 current file. A pound sign (#) is replaced by the name of
652 the previously examined file.
653
654
655 |
656
657
658
659
660 s filename
661
662
663 Save the input to a file. This only works if the input is a
664 pipe, not an ordinary file.
665 !!OPTIONS
666
667
668 Command line options are described below. Most options may
669 be changed while ''less'' is running, via the
670 ''
671
672
673 Most options may be given in one of two forms: either a dash
674 followed by a single letter, or two dashes followed by a
675 long option name. A long option name may be abbreviated as
676 long as the abbreviation is unambiguous. For example,
677 --quit-at-eof may be abbreviated --quit, but not --qui,
678 since both --quit-at-eof and --quiet begin with --qui. Some
679 long option names are in uppercase, such as --QUIT-AT-EOF,
680 as distinct from --quit-at-eof. Such option names need only
681 have their first letter capitalized; the remainder of the
682 name may be in either case. For example, --Quit-at-eof is
683 equivalent to --QUIT-AT-EOF.
684
685
686 Options are also taken from the environment variable
687 less'' is invoked, you
688 might tell ''csh:''
689
690
691 setenv LESS
692
693
694 or if you use ''sh:''
695
696
697 LESS=
698
699
700 On MS-DOS, you don't need the quotes, but you should replace
701 any percent signs in the options string by double percent
702 signs.
703
704
705 The environment variable is parsed before the command line,
706 so command line options override the LESS environment
707 variable. If an option appears in the LESS variable, it can
708 be reset to its default value on the command line by
709 beginning the command line option with
710
711
712 For options like -P or -D which take a following string, a
713 dollar sign ($) must be used to signal the end of the
714 string. For example, to set two -D options on MS-DOS, you
715 must have a dollar sign between them, like
716 this:
717
718
719 LESS=
720
721
722 -? or --help
723
724
725 This option displays a summary of the commands accepted by
726 ''less'' (the same as the h command). (Depending on how
727 your shell interprets the question mark, it may be necessary
728 to quote the question mark, thus:
729 ''
730
731
732 -a or --search-skip-screen
733
734
735 Causes searches to start after the last line displayed on
736 the screen, thus skipping all lines displayed on the screen.
737 By default, searches start at the second line on the screen
738 (or after the last found line; see the -j
739 option).
740
741
742 -b''n'' or --buffers=''n''
743
744
745 Specifies the amount of buffer space ''less'' will use
746 for each file, in units of kilobytes (1024 bytes). By
747 default 64K of buffer space is used for each file (unless
748 the file is a pipe; see the -B option). The -b option
749 specifies instead that ''n'' kilobytes of buffer space
750 should be used for each file. If ''n'' is -1, buffer
751 space is unlimited; that is, the entire file is read into
752 memory.
753
754
755 -B or --auto-buffers
756
757
758 By default, when data is read from a pipe, buffers are
759 allocated automatically as needed. If a large amount of data
760 is read from the pipe, this can cause a large amount of
761 memory to be allocated. The -B option disables this
762 automatic allocation of buffers for pipes, so that only 64K
763 (or the amount of space specified by the -b option) is used
764 for the pipe. Warning: use of -B can result in erroneous
765 display, since only the most recently viewed part of the
766 file is kept in memory; any earlier data is
767 lost.
768
769
770 -c or --clear-screen
771
772
773 Causes full screen repaints to be painted from the top line
774 down. By default, full screen repaints are done by scrolling
775 from the bottom of the screen.
776
777
778 -C or --CLEAR-SCREEN
779
780
781 The -C option is like -c, but the screen is cleared before
782 it is repainted.
783
784
785 -d or --dumb
786
787
788 The -d option suppresses the error message normally
789 displayed if the terminal is dumb; that is, lacks some
790 important capability, such as the ability to clear the
791 screen or scroll backward. The -d option does not otherwise
792 change the behavior of ''less'' on a dumb
793 terminal.
794
795
796 -D__x__''color'' or
797 --color=__x__''color''
798
799
800 [[MS-DOS only] Sets the color of the text displayed. __x__
801 is a single character which selects the type of text whose
802 color is being set: n=normal, s=standout, d=bold,
803 u=underlined, k=blink. ''color'' is a pair of numbers
804 separated by a period. The first number selects the
805 foreground color and the second selects the background color
806 of the text. A single number ''N'' is the same as
807 ''N.0''.
808
809
810 -e or --quit-at-eof
811
812
813 Causes ''less'' to automatically exit the second time it
814 reaches end-of-file. By default, the only way to exit
815 ''less'' is via the ''
816
817
818 -E or --QUIT-AT-EOF
819
820
821 Causes ''less'' to automatically exit the first time it
822 reaches end-of-file.
823
824
825 -f or --force
826
827
828 Forces non-regular files to be opened. (A non-regular file
829 is a directory or a device special file.) Also suppresses
830 the warning message when a binary file is opened. By
831 default, ''less'' will refuse to open non-regular
832 files.
833
834
835 -F or --quit-if-one-screen
836
837
838 Causes ''less'' to automatically exit if the entire file
839 can be displayed on the first screen.
840
841
842 -g or --hilite-search
843
844
845 Normally, ''less'' will highlight ALL strings which match
846 the last search command. The -g option changes this behavior
847 to highlight only the particular string which was found by
848 the last search command. This can cause ''less'' to run
849 somewhat faster than the default.
850
851
852 -G or --HILITE-SEARCH
853
854
855 The -G option suppresses all highlighting of strings found
856 by search commands.
857
858
859 -h''n'' or ---max-back-scroll=''n''
860
861
862 Specifies a maximum number of lines to scroll backward. If
863 it is necessary to scroll backward more than ''n'' lines,
864 the screen is repainted in a forward direction instead. (If
865 the terminal does not have the ability to scroll backward,
866 -h0 is implied.)
867
868
869 -i or --ignore-case
870
871
872 Causes searches to ignore case; that is, uppercase and
873 lowercase are considered identical. This option is ignored
874 if any uppercase letters appear in the search pattern; in
875 other words, if a pattern contains uppercase letters, then
876 that search does not ignore case.
877
878
879 -I or --IGNORE-CASE
880
881
882 Like -i, but searches ignore case even if the pattern
883 contains uppercase letters.
884
885
886 -j''n'' or --jump-target=''n''
887
888
889 Specifies a line on the screen where the
890
891
892 -J or --status-column
893
894
895 Displays a status column at the left edge of the screen. The
896 status column shows the lines that matched the current
897 search. The status column is also used if the -w or -W
898 option is in effect.
899
900
901 -k''filename'' or
902 --lesskey-file=''filename''
903
904
905 Causes ''less'' to open and interpret the named file as a
906 ''lesskey'' (1) file. Multiple -k options may be
907 specified. If the LESSKEY or LESSKEY_SYSTEM environment
908 variable is set, or if a lesskey file is found in a standard
909 place (see KEY BINDINGS), it is also used as a
910 ''lesskey'' file.
911
912
913 -m or --long-prompt
914
915
916 Causes ''less'' to prompt verbosely (like ''more''),
917 with the percent into the file. By default, ''less''
918 prompts with a colon.
919
920
921 -M or --LONG-PROMPT
922
923
924 Causes ''less'' to prompt even more verbosely than
925 ''more.''
926
927
928 -n or --line-numbers
929
930
931 Suppresses line numbers. The default (to use line numbers)
932 may cause ''less'' to run more slowly in some cases,
933 especially with a very large input file. Suppressing line
934 numbers with the -n option will avoid this problem. Using
935 line numbers means: the line number will be displayed in the
936 verbose prompt and in the = command, and the v command will
937 pass the current line number to the editor (see also the
938 discussion of LESSEDIT in PROMPTS below).
939
940
941 -N or --LINE-NUMBERS
942
943
944 Causes a line number to be displayed at the beginning of
945 each line in the display.
946
947
948 -o''filename'' or --log-file=''filename''
949
950
951 Causes ''less'' to copy its input to the named file as it
952 is being viewed. This applies only when the input file is a
953 pipe, not an ordinary file. If the file already exists,
954 ''less'' will ask for confirmation before overwriting
955 it.
956
957
958 -O''filename'' or --LOG-FILE=''filename''
959
960
961 The -O option is like -o, but it will overwrite an existing
962 file without asking for confirmation.
963
964
965 If no log file has been specified, the -o and -O options can
966 be used from within ''less'' to specify a log file.
967 Without a file name, they will simply report the name of the
968 log file. The
969 ''less.''
970
971
972 -p''pattern'' or --pattern=''pattern''
973
974
975 The -p option on the command line is equivalent to
976 specifying +/''pattern''; that is, it tells ''less''
977 to start at the first occurrence of ''pattern'' in the
978 file.
979
980
981 -P''prompt'' or --prompt=''prompt''
982
983
984 Provides a way to tailor the three prompt styles to your own
985 preference. This option would normally be put in the LESS
986 environment variable, rather than being typed in with each
987 ''less'' command. Such an option must either be the last
988 option in the LESS variable, or be terminated by a dollar
989 sign. -Ps followed by a string changes the default (short)
990 prompt to that string. -Pm changes the medium (-m) prompt.
991 -PM changes the long (-M) prompt. -Ph changes the prompt for
992 the help screen. -P= changes the message printed by the =
993 command. -Pw changes the message printed while waiting for
994 data (in the F command). All prompt strings consist of a
995 sequence of letters and special escape sequences. See the
996 section on PROMPTS for more details.
997
998
999 -q or --quiet or --silent
1000
1001
1002 Causes moderately
1003
1004
1005 -Q or --QUIET or --SILENT
1006
1007
1008 Causes totally
1009
1010
1011 -r or --raw-control-chars
1012
1013
1014 Causes
1015 less'' cannot keep track of the actual appearance of
1016 the screen (since this depends on how the screen responds to
1017 each type of control character). Thus, various display
1018 problems may result, such as long lines being split in the
1019 wrong place.
1020
1021
1022 -R or --RAW-CONTROL-CHARS
1023
1024
1025 Like -r, but tries to keep track of the screen appearance
1026 where possible. This works only if the input consists of
1027 normal text and possibly some ANSI
1028
1029
1030 ESC [[ ... m
1031
1032
1033 where the
1034 less'' think that characters other than
1035 ''
1036
1037
1038 -s or --squeeze-blank-lines
1039
1040
1041 Causes consecutive blank lines to be squeezed into a single
1042 blank line. This is useful when viewing ''nroff''
1043 output.
1044
1045
1046 -S or --chop-long-lines
1047
1048
1049 Causes lines longer than the screen width to be chopped
1050 rather than folded. That is, the remainder of a long line is
1051 simply discarded. The default is to fold long lines; that
1052 is, display the remainder on the next line.
1053
1054
1055 -t''tag'' or --tag=''tag''
1056
1057
1058 The -t option, followed immediately by a TAG, will edit the
1059 file containing that tag. For this to work, tag information
1060 must be available; for example, there may be a file in the
1061 current directory called
1062 ctags'' (1) or an equivalent
1063 command. If the environment variable LESSGLOBALTAGS is set,
1064 it is taken to be the name of a command compatible with
1065 ''global'' (1), and that command is executed to find the
1066 tag. (See http://www.gnu.org/software/global/global.html).
1067 The -t option may also be specified from within ''less''
1068 (using the - command) as a way of examining a new file. The
1069 command
1070 ''less.''
1071
1072
1073 -T''tagsfile'' or --tag-file=''tagsfile''
1074
1075
1076 Specifies a tags file to be used instead of
1077
1078
1079 -u or --underline-special
1080
1081
1082 Causes backspaces and carriage returns to be treated as
1083 printable characters; that is, they are sent to the terminal
1084 when they appear in the input.
1085
1086
1087 -U or --UNDERLINE-SPECIAL
1088
1089
1090 Causes backspaces, tabs and carriage returns to be treated
1091 as control characters; that is, they are handled as
1092 specified by the -r option.
1093
1094
1095 By default, if neither -u nor -U is given, backspaces which
1096 appear adjacent to an underscore character are treated
1097 specially: the underlined text is displayed using the
1098 terminal's hardware underlining capability. Also, backspaces
1099 which appear between two identical characters are treated
1100 specially: the overstruck text is printed using the
1101 terminal's hardware boldface capability. Other backspaces
1102 are deleted, along with the preceding character. Carriage
1103 returns immediately followed by a newline are deleted. other
1104 carriage returns are handled as specified by the -r option.
1105 Text which is overstruck or underlined can be searched for
1106 if neither -u nor -U is in effect.
1107
1108
1109 -V or --version
1110
1111
1112 Displays the version number of ''less.''
1113
1114
1115 -w or --hilite-unread
1116
1117
1118 Temporarily highlights the first
1119
1120
1121 -W or --HILITE-UNREAD
1122
1123
1124 Like -w, but temporarily highlights the first new line after
1125 any forward movement command larger than one
1126 line.
1127
1128
1129 -x''n'',... or --tabs=''n'',...
1130
1131
1132 Sets tab stops. If only one ''n'' is specified, tab stops
1133 are set at multiples of ''n''. If multiple values
1134 separated by commas are specified, tab stops are set at
1135 those positions, and then continue with the same spacing as
1136 the last two. For example, ''-x9,17'' will set tabs at
1137 positions 9, 17, 25, 33, etc. The default for ''n'' is
1138 8.
1139
1140
1141 -X or --no-init
1142
1143
1144 Disables sending the termcap initialization and
1145 deinitialization strings to the terminal. This is sometimes
1146 desirable if the deinitialization string does something
1147 unnecessary, like clearing the screen.
1148
1149
1150 --no-keypad
1151
1152
1153 Disables sending the keypad initialization and
1154 deinitialization strings to the terminal. This is sometimes
1155 useful if the keypad strings make the numeric keypad behave
1156 in an undesirable manner.
1157
1158
1159 -y''n'' or --max-forw-scroll=''n''
1160
1161
1162 Specifies a maximum number of lines to scroll forward. If it
1163 is necessary to scroll forward more than ''n'' lines, the
1164 screen is repainted instead. The -c or -C option may be used
1165 to repaint from the top of the screen if desired. By
1166 default, any forward movement causes scrolling.
1167
1168
1169 -[[z]''n'' or --window=''n''
1170
1171
1172 Changes the default scrolling window size to ''n'' lines.
1173 The default is one screenful. The z and w commands can also
1174 be used to change the window size. The
1175 ''more.'' If the number
1176 ''n'' is negative, it indicates ''n'' lines less than
1177 the current screen size. For example, if the screen is 24
1178 lines, ''-z-4'' sets the scrolling window to 20 lines. If
1179 the screen is resized to 40 lines, the scrolling window
1180 automatically changes to 36 lines.
1181
1182
1183 -cc'' or --quotes=''cc''
1184
1185
1186 Changes the filename quoting character. This may be
1187 necessary if you are trying to name a file which contains
1188 both spaces and quote characters. Followed by a single
1189 character, this changes the quote character to that
1190 character. Filenames containing a space should then be
1191 surrounded by that character rather than by double quotes.
1192 Followed by two characters, changes the open quote to the
1193 first character, and the close quote to the second
1194 character. Filenames containing a space should then be
1195 preceded by the open quote character and followed by the
1196 close quote character. Note that even after the quote
1197 characters are changed, this option remains -
1198
1199
1200 -~ or --tilde
1201
1202
1203 Normally lines after end of file are displayed as a single
1204 tilde (~). This option causes lines after end of file to be
1205 displayed as blank lines.
1206
1207
1208 -# or --shift
1209
1210
1211 Specifies the default number of positions to scroll
1212 horizontally in the RIGHTARROW and LEFTARROW commands. If
1213 the number specified is zero, it sets the default number of
1214 positions to one half of the screen width.
1215
1216
1217 --
1218
1219
1220 A command line argument of
1221
1222
1223 +
1224
1225
1226 If a command line option begins with __+__, the remainder
1227 of that option is taken to be an initial command to
1228 ''less.'' For example, +G tells ''less'' to start at
1229 the end of the file rather than the beginning, and +/xyz
1230 tells it to start at the first occurrence of
1231 ''
1232 !!LINE EDITING
1233
1234
1235 When entering command line at the bottom of the screen (for
1236 example, a filename for the :e command, or the pattern for a
1237 search command), certain keys can be used to manipulate the
1238 command line. Most commands have an alternate form in [[
1239 brackets ] which can be used if a key does not exist on a
1240 particular keyboard. (The bracketed forms do not work in the
1241 MS-DOS version.) Any of these special keys may be entered
1242 literally by preceding it with the
1243
1244
1245 LEFTARROW [[ ESC-h ]
1246
1247
1248 Move the cursor one space to the left.
1249
1250
1251 RIGHTARROW [[ ESC-l ]
1252
1253
1254 Move the cursor one space to the right.
1255
1256
1257 ^LEFTARROW [[ ESC-b or ESC-LEFTARROW ]
1258
1259
1260 (That is, CONTROL and LEFTARROW simultaneously.) Move the
1261 cursor one word to the left.
1262
1263
1264 ^RIGHTARROW [[ ESC-w or ESC-RIGHTARROW ]
1265
1266
1267 (That is, CONTROL and RIGHTARROW simultaneously.) Move the
1268 cursor one word to the right.
1269
1270
1271 HOME [[ ESC-0 ]
1272
1273
1274 Move the cursor to the beginning of the line.
1275
1276
1277 END [[ ESC-$ ]
1278
1279
1280 Move the cursor to the end of the line.
1281
1282
1283 BACKSPACE
1284
1285
1286 Delete the character to the left of the cursor, or cancel
1287 the command if the command line is empty.
1288
1289
1290 DELETE or [[ ESC-x ]
1291
1292
1293 Delete the character under the cursor.
1294
1295
1296 ^BACKSPACE [[ ESC-BACKSPACE ]
1297
1298
1299 (That is, CONTROL and BACKSPACE simultaneously.) Delete the
1300 word to the left of the cursor.
1301
1302
1303 ^DELETE [[ ESC-X or ESC-DELETE ]
1304
1305
1306 (That is, CONTROL and DELETE simultaneously.) Delete the
1307 word under the cursor.
1308
1309
1310 UPARROW [[ ESC-k ]
1311
1312
1313 Retrieve the previous command line.
1314
1315
1316 DOWNARROW [[ ESC-j ]
1317
1318
1319 Retrieve the next command line.
1320
1321
1322 TAB
1323
1324
1325 Complete the partial filename to the left of the cursor. If
1326 it matches more than one filename, the first match is
1327 entered into the command line. Repeated TABs will cycle thru
1328 the other matching filenames. If the completed filename is a
1329 directory, a
1330
1331
1332 BACKTAB [[ ESC-TAB ]
1333
1334
1335 Like, TAB, but cycles in the reverse direction thru the
1336 matching filenames.
1337
1338
1339 ^L
1340
1341
1342 Complete the partial filename to the left of the cursor. If
1343 it matches more than one filename, all matches are entered
1344 into the command line (if they fit).
1345
1346
1347 ^U (Unix and OS/2) or ESC (MS-DOS)
1348
1349
1350 Delete the entire command line, or cancel the command if the
1351 command line is empty. If you have changed your line-kill
1352 character in Unix to something other than ^U, that character
1353 is used instead of ^U.
1354 !!KEY BINDINGS
1355
1356
1357 You may define your own ''less'' commands by using the
1358 program ''lesskey'' (1) to create a lesskey file. This
1359 file specifies a set of command keys and an action
1360 associated with each key. You may also use ''lesskey'' to
1361 change the line-editing keys (see LINE EDITING), and to set
1362 environment variables. If the environment variable LESSKEY
1363 is set, ''less'' uses that as the name of the lesskey
1364 file. Otherwise, ''less'' looks in a standard place for
1365 the lesskey file: On Unix systems, ''less'' looks for a
1366 lesskey file called
1367 ''less'' looks for a lesskey file called
1368 ''less'' looks for a lesskey file called
1369 ''lesskey'' manual page for
1370 more details.
1371
1372
1373 A system-wide lesskey file may also be set up to provide key
1374 bindings. If a key is defined in both a local lesskey file
1375 and in the system-wide file, key bindings in the local file
1376 take precedence over those in the system-wide file. If the
1377 environment variable LESSKEY_SYSTEM is set, ''less'' uses
1378 that as the name of the system-wide lesskey file. Otherwise,
1379 ''less'' looks in a standard place for the system-wide
1380 lesskey file: On Unix systems, the system-wide lesskey file
1381 is /usr/local/etc/sysless. (However, if ''less'' was
1382 built with a different sysconf directory than
1383 /usr/local/etc, that directory is where the sysless file is
1384 found.) On MS-DOS and Windows systems, the system-wide
1385 lesskey file is c:_sysless. On OS/2 systems, the system-wide
1386 lesskey file is c:sysless.ini.
1387 !!INPUT PREPROCESSOR
1388
1389
1390 You may define an
1391 less.'' Before ''less'' opens a file, it first gives
1392 your input preprocessor a chance to modify the way the
1393 contents of the file are displayed. An input preprocessor is
1394 simply an executable program (or shell script), which writes
1395 the contents of the file to a different file, called the
1396 replacement file. The contents of the replacement file are
1397 then displayed in place of the contents of the original
1398 file. However, it will appear to the user as if the original
1399 file is opened; that is, ''less'' will display the
1400 original filename as the name of the current
1401 file.
1402
1403
1404 An input preprocessor receives one command line argument,
1405 the original filename, as entered by the user. It should
1406 create the replacement file, and when finished, print the
1407 name of the replacement file to its standard output. If the
1408 input preprocessor does not output a replacement filename,
1409 ''less'' uses the original file, as normal. The input
1410 preprocessor is not called when viewing standard input. To
1411 set up an input preprocessor, set the LESSOPEN environment
1412 variable to a command line which will invoke your input
1413 preprocessor. This command line should include one
1414 occurrence of the string
1415 ''
1416
1417
1418 When ''less'' closes a file opened in such a way, it will
1419 call another program, called the input postprocessor, which
1420 may perform any desired clean-up action (such as deleting
1421 the replacement file created by LESSOPEN). This program
1422 receives two command line arguments, the original filename
1423 as entered by the user, and the name of the replacement
1424 file. To set up an input postprocessor, set the LESSCLOSE
1425 environment variable to a command line which will invoke
1426 your input postprocessor. It may include two occurrences of
1427 the string
1428 ''
1429
1430
1431 For example, on many Unix systems, these two scripts will
1432 allow you to keep files in compressed format, but still let
1433 ''less'' view them directly:
1434
1435
1436 lessopen.sh:
1437 #! /bin/sh
1438 case
1439 *.Z) uncompress -c $1
1440 if [[ -s /tmp/less.$$ ]; then
1441 echo /tmp/less.$$
1442 else
1443 rm -f /tmp/less.$$
1444 fi
1445 ;;
1446 esac
1447
1448
1449 lessclose.sh:
1450 #! /bin/sh
1451 rm $2
1452
1453
1454 To use these scripts, put them both where they can be
1455 executed and set LESSOPEN=
1456
1457
1458 It is also possible to set up an input preprocessor to pipe
1459 the file data directly to ''less,'' rather than putting
1460 the data into a replacement file. This avoids the need to
1461 decompress the entire file before starting to view it. An
1462 input preprocessor that works this way is called an input
1463 pipe. An input pipe, instead of writing the name of a
1464 replacement file on its standard output, writes the entire
1465 contents of the replacement file on its standard output. If
1466 the input pipe does not write any characters on its standard
1467 output, then there is no replacement file and ''less''
1468 uses the original file, as normal. To use an input pipe,
1469 make the first character in the LESSOPEN environment
1470 variable a vertical bar (|) to signify that the input
1471 preprocessor is an input pipe.
1472
1473
1474 For example, on many Unix systems, this script will work
1475 like the previous example scripts:
1476
1477
1478 lesspipe.sh:
1479 #! /bin/sh
1480 case
1481 *.Z) uncompress -c $1 2
1482 ;;
1483 esac
1484
1485
1486 To use this script, put it where it can be executed and set
1487 LESSOPEN=
1488 !!NATIONAL CHARACTER SETS
1489
1490
1491 There are three types of characters in the input
1492 file:
1493
1494
1495 normal characters
1496
1497
1498 can be displayed directly to the screen.
1499
1500
1501 control characters
1502
1503
1504 should not be displayed directly, but are expected to be
1505 found in ordinary text files (such as backspace and
1506 tab).
1507
1508
1509 binary characters
1510
1511
1512 should not be displayed directly and are not expected to be
1513 found in text files.
1514
1515
1516 A
1517
1518
1519 ascii
1520
1521
1522 BS, TAB, NL, CR, and formfeed are control characters, all
1523 chars with values between 32 and 126 are normal, and all
1524 others are binary.
1525
1526
1527 iso8859
1528
1529
1530 Selects an ISO 8859 character set. This is the same as
1531 ASCII, except characters between 160 and 255 are treated as
1532 normal characters.
1533
1534
1535 latin1
1536
1537
1538 Same as iso8859.
1539
1540
1541 latin9
1542
1543
1544 Same as iso8859.
1545
1546
1547 dos
1548
1549
1550 Selects a character set appropriate for MS-DOS.
1551
1552
1553 ebcdic
1554
1555
1556 Selects an EBCDIC character set.
1557
1558
1559 IBM-1047
1560
1561
1562 Selects an EBCDIC character set used by OS/390 Unix
1563 Services. This is the EBCDIC analogue of latin1. You get
1564 similar results by setting either LESSCHARSET=IBM-1047 or
1565 LC_CTYPE=en_US in your environment.
1566
1567
1568 koi8-r
1569
1570
1571 Selects a Russian character set.
1572
1573
1574 next
1575
1576
1577 Selects a character set appropriate for NeXT
1578 computers.
1579
1580
1581 utf-8
1582
1583
1584 Selects the UTF-8 encoding of the ISO 10646 character
1585 set.
1586
1587
1588 In special cases, it may be desired to tailor ''less'' to
1589 use a character set other than the ones definable by
1590 LESSCHARSET. In this case, the environment variable
1591 LESSCHARDEF can be used to define a character set. It should
1592 be set to a string where each character in the string
1593 represents one character in the character set. The character
1594 ''
1595
1596
1597 This table shows the value of LESSCHARDEF which is
1598 equivalent to each of the possible values for
1599 LESSCHARSET:
1600
1601
1602 ascii 8bcccbcc18b95.b
1603 dos 8bcccbcc12bc5b95.b.
1604 ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b
1605 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b.
1606 IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc 191.b
1607 iso8859 8bcccbcc18b95.33b.
1608 koi8-r 8bcccbcc18b95.b128.
1609 latin1 8bcccbcc18b95.33b.
1610 next 8bcccbcc18b95.bb125.bb
1611
1612
1613 If neither LESSCHARSET nor LESSCHARDEF is set, but the
1614 string
1615
1616
1617 If that string is not found, but your system supports the
1618 ''setlocale'' interface, ''less'' will use setlocale
1619 to determine the character set. setlocale is controlled by
1620 setting the LANG or LC_CTYPE environment
1621 variables.
1622
1623
1624 Finally, if the ''setlocale'' interface is also not
1625 available, the default character set is latin1.
1626
1627
1628 Control and binary characters are displayed in standout
1629 (reverse video). Each such character is displayed in caret
1630 notation if possible (e.g. ^A for control-A). Caret notation
1631 is used only if inverting the 0100 bit results in a normal
1632 printable character. Otherwise, the character is displayed
1633 as a hex number in angle brackets. This format can be
1634 changed by setting the LESSBINFMT environment variable.
1635 LESSBINFMT may begin with a
1636 !!PROMPTS
1637
1638
1639 The -P option allows you to tailor the prompt to your
1640 preference. The string given to the -P option replaces the
1641 specified prompt string. Certain characters in the string
1642 are interpreted specially. The prompt mechanism is rather
1643 complicated to provide flexibility, but the ordinary user
1644 need not understand the details of constructing personalized
1645 prompt strings.
1646
1647
1648 A percent sign followed by a single character is expanded
1649 according to what the following character is:
1650
1651
1652 %b''X''
1653
1654
1655 Replaced by the byte offset into the current input file. The
1656 b is followed by a single character (shown as ''X''
1657 above) which specifies the line whose byte offset is to be
1658 used. If the character is a
1659 ''
1660
1661
1662 %B
1663
1664
1665 Replaced by the size of the current input file.
1666
1667
1668 %c
1669
1670
1671 Replaced by the column number of the text appearing in the
1672 first column of the screen.
1673
1674
1675 %d''X''
1676
1677
1678 Replaced by the page number of a line in the input file. The
1679 line to be used is determined by the ''X'', as with the
1680 %b option.
1681
1682
1683 %D
1684
1685
1686 Replaced by the number of pages in the input file, or
1687 equivalently, the page number of the last line in the input
1688 file.
1689
1690
1691 %E
1692
1693
1694 Replaced by the name of the editor (from the VISUAL
1695 environment variable, or the EDITOR environment variable if
1696 VISUAL is not defined). See the discussion of the LESSEDIT
1697 feature below.
1698
1699
1700 %f
1701
1702
1703 Replaced by the name of the current input file.
1704
1705
1706 %i
1707
1708
1709 Replaced by the index of the current file in the list of
1710 input files.
1711
1712
1713 %l''X''
1714
1715
1716 Replaced by the line number of a line in the input file. The
1717 line to be used is determined by the ''X'', as with the
1718 %b option.
1719
1720
1721 %L
1722
1723
1724 Replaced by the line number of the last line in the input
1725 file.
1726
1727
1728 %m
1729
1730
1731 Replaced by the total number of input files.
1732
1733
1734 %p''X''
1735
1736
1737 Replaced by the percent into the current input file, based
1738 on byte offsets. The line used is determined by the ''X''
1739 as with the %b option.
1740
1741
1742 %P''X''
1743
1744
1745 Replaced by the percent into the current input file, based
1746 on line numbers. The line used is determined by the ''X''
1747 as with the %b option.
1748
1749
1750 %s
1751
1752
1753 Same as %B.
1754
1755
1756 %t
1757
1758
1759 Causes any trailing spaces to be removed. Usually used at
1760 the end of the string, but may appear anywhere.
1761
1762
1763 %x
1764
1765
1766 Replaced by the name of the next input file in the
1767 list.
1768
1769
1770 If any item is unknown (for example, the file size if input
1771 is a pipe), a question mark is printed instead.
1772
1773
1774 The format of the prompt string can be changed depending on
1775 certain conditions. A question mark followed by a single
1776 character acts like an
1777
1778
1779 ?a
1780
1781
1782 True if any characters have been included in the prompt so
1783 far.
1784
1785
1786 ?b''X''
1787
1788
1789 True if the byte offset of the specified line is
1790 known.
1791
1792
1793 ?B
1794
1795
1796 True if the size of current input file is
1797 known.
1798
1799
1800 ?c
1801
1802
1803 True if the text is horizontally shifted (%c is not
1804 zero).
1805
1806
1807 ?d''X''
1808
1809
1810 True if the page number of the specified line is
1811 known.
1812
1813
1814 ?e
1815
1816
1817 True if at end-of-file.
1818
1819
1820 ?f
1821
1822
1823 True if there is an input filename (that is, if input is not
1824 a pipe).
1825
1826
1827 ?l''X''
1828
1829
1830 True if the line number of the specified line is
1831 known.
1832
1833
1834 ?L
1835
1836
1837 True if the line number of the last line in the file is
1838 known.
1839
1840
1841 ?m
1842
1843
1844 True if there is more than one input file.
1845
1846
1847 ?n
1848
1849
1850 True if this is the first prompt in a new input
1851 file.
1852
1853
1854 ?p''X''
1855
1856
1857 True if the percent into the current input file, based on
1858 byte offsets, of the specified line is known.
1859
1860
1861 ?P''X''
1862
1863
1864 True if the percent into the current input file, based on
1865 line numbers, of the specified line is known.
1866
1867
1868 ?s
1869
1870
1871 Same as
1872
1873
1874 ?x
1875
1876
1877 True if there is a next input file (that is, if the current
1878 input file is not the last one).
1879
1880
1881 Any characters other than the special ones (question mark,
1882 colon, period, percent, and backslash) become literally part
1883 of the prompt. Any of the special characters may be included
1884 in the prompt literally by preceding it with a
1885 backslash.
1886
1887
1888 Some examples:
1889
1890
1891 ?f%f:Standard input.
1892
1893
1894 This prompt prints the filename, if known; otherwise the
1895 string
1896
1897
1898 ?f%f .?ltLine %lt:?pt%pt%:?btByte %bt:-...
1899
1900
1901 This prompt would print the filename, if known. The filename
1902 is followed by the line number, if known, otherwise the
1903 percent if known, otherwise the byte offset if known.
1904 Otherwise, a dash is printed. Notice how each question mark
1905 has a matching period, and how the % after the %pt is
1906 included literally by escaping it with a
1907 backslash.
1908
1909
1910 ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next:
1911 %x..%t
1912
1913
1914 This prints the filename if this is the first prompt in a
1915 file, followed by the
1916
1917
1918 ?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next: %x.:
1919 ?pB%pB%:byte %bB?s/%s...%t
1920 ?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. :
1921 byte %bB?s/%s. .?e(END) ?x- Next: %x.:?pB%pB%..%t
1922 And here is the default message produced by the = command:
1923
1924
1925 ?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .
1926 byte %bB?s/%s. ?e(END) :?pB%pB%..%t
1927 The prompt expansion features are also used for another purpose: if an environment variable LESSEDIT is defined, it is used as the command to be executed when the v command is invoked. The LESSEDIT string is expanded in the same way as the prompt strings. The default value for LESSEDIT is:
1928
1929
1930 %E ?lm+%lm. %f
1931 Note that this expands to the editor name, followed by a + and the line number, followed by the file name. If your editor does not accept the
1932 !!SECURITY
1933
1934
1935 When the environment variable LESSSECURE is set to 1,
1936 ''less'' runs in a
1937 ''
1938
1939
1940 !
1941
1942
1943 the shell command
1944
1945
1946 |
1947
1948
1949 the pipe command
1950
1951
1952 :e
1953
1954
1955 the examine command.
1956
1957
1958 v
1959
1960
1961 the editing command
1962
1963
1964 s -o
1965
1966
1967 log files
1968
1969
1970 -k
1971
1972
1973 use of lesskey files
1974
1975
1976 -t
1977
1978
1979 use of tags files
1980
1981
1982 metacharacters in filenames, such as *
1983
1984
1985 filename completion (TAB, ^L)
1986
1987
1988 Less can also be compiled to be permanently in
1989 !!ENVIRONMENT VARIABLES
1990
1991
1992 Environment variables may be specified either in the system
1993 environment as usual, or in a ''lesskey'' (1) file. If
1994 environment variables are defined in more than one place,
1995 variables defined in a local lesskey file take precedence
1996 over variables defined in the system environment, which take
1997 precedence over variables defined in the system-wide lesskey
1998 file.
1999
2000
2001 COLUMNS
2002
2003
2004 Sets the number of columns on the screen. Takes precedence
2005 over the number of columns specified by the TERM variable.
2006 (But if you have a windowing system which supports
2007 TIOCGWINSZ or WIOCGETD, the window system's idea of the
2008 screen size takes precedence over the LINES and COLUMNS
2009 environment variables.)
2010
2011
2012 EDITOR
2013
2014
2015 The name of the editor (used for the v
2016 command).
2017
2018
2019 HOME
2020
2021
2022 Name of the user's home directory (used to find a lesskey
2023 file on Unix and OS/2 systems).
2024
2025
2026 HOMEDRIVE, HOMEPATH
2027
2028
2029 Concatenation of the HOMEDRIVE and HOMEPATH environment
2030 variables is the name of the user's home directory if the
2031 HOME variable is not set (only in the Windows
2032 version).
2033
2034
2035 INIT
2036
2037
2038 Name of the user's init directory (used to find a lesskey
2039 file on OS/2 systems).
2040
2041
2042 LANG
2043
2044
2045 Language for determining the character set.
2046
2047
2048 LC_CTYPE
2049
2050
2051 Language for determining the character set.
2052
2053
2054 LESS
2055
2056
2057 Options which are passed to ''less''
2058 automatically.
2059
2060
2061 LESSANSIENDCHARS
2062
2063
2064 Characters which are assumed to end an ANSI color escape
2065 sequence (default
2066
2067
2068 LESSBINFMT
2069
2070
2071 Format for displaying non-printable, non-control
2072 characters.
2073
2074
2075 LESSCHARDEF
2076
2077
2078 Defines a character set.
2079
2080
2081 LESSCHARSET
2082
2083
2084 Selects a predefined character set.
2085
2086
2087 LESSCLOSE
2088
2089
2090 Command line to invoke the (optional)
2091 input-postprocessor.
2092
2093
2094 LESSECHO
2095
2096
2097 Name of the lessecho program (default
2098
2099
2100 LESSEDIT
2101
2102
2103 Editor prototype string (used for the v command). See
2104 discussion under PROMPTS.
2105
2106
2107 LESSGLOBALTAGS
2108
2109
2110 Name of the command used by the -t option to find global
2111 tags. Normally should be set to
2112 global'' (1) command. If not set, global
2113 tags are not used.
2114
2115
2116 LESSKEY
2117
2118
2119 Name of the default lesskey(1) file.
2120
2121
2122 LESSKEY_SYSTEM
2123
2124
2125 Name of the default system-wide lesskey(1)
2126 file.
2127
2128
2129 LESSMETACHARS
2130
2131
2132 List of characters which are considered
2133
2134
2135 LESSMETAESCAPE
2136
2137
2138 Prefix which less will add before each metacharacter in a
2139 command sent to the shell. If LESSMETAESCAPE is an empty
2140 string, commands containing metacharacters will not be
2141 passed to the shell.
2142
2143
2144 LESSOPEN
2145
2146
2147 Command line to invoke the (optional)
2148 input-preprocessor.
2149
2150
2151 LESSSECURE
2152
2153
2154 Runs less in
2155
2156
2157 LESSSEPARATOR
2158
2159
2160 String to be appended to a directory name in filename
2161 completion.
2162
2163
2164 LINES
2165
2166
2167 Sets the number of lines on the screen. Takes precedence
2168 over the number of lines specified by the TERM variable.
2169 (But if you have a windowing system which supports
2170 TIOCGWINSZ or WIOCGETD, the window system's idea of the
2171 screen size takes precedence over the LINES and COLUMNS
2172 environment variables.)
2173
2174
2175 PATH
2176
2177
2178 User's search path (used to find a lesskey file on MS-DOS
2179 and OS/2 systems).
2180
2181
2182 SHELL
2183
2184
2185 The shell used to execute the ! command, as well as to
2186 expand filenames.
2187
2188
2189 TERM
2190
2191
2192 The type of terminal on which ''less'' is being
2193 run.
2194
2195
2196 VISUAL
2197
2198
2199 The name of the editor (used for the v
2200 command).
2201 !!SEE ALSO
2202
2203
2204 lesskey(1)
2205 !!WARNINGS
2206
2207
2208 The = command and prompts (unless changed by -P) report the
2209 line numbers of the lines at the top and bottom of the
2210 screen, but the byte and percent of the line after the one
2211 at the bottom of the screen.
2212
2213
2214 If the :e command is used to name more than one file, and
2215 one of the named files has been viewed previously, the new
2216 files may be entered into the list in an unexpected
2217 order.
2218
2219
2220 On certain older terminals (the so-called
2221
2222
2223 In certain cases, when search highlighting is enabled and a
2224 search pattern begins with a ^, more text than the matching
2225 string may be highlighted. (This problem does not occur when
2226 less is compiled to use the POSIX regular expression
2227 package.)
2228
2229
2230 When viewing text containing ANSI color escape sequences
2231 using the -R option, searching will not find text containing
2232 an embedded escape sequence. Also, search highlighting may
2233 change the color of some of the text which follows the
2234 highlighted text.
2235
2236
2237 On some systems, ''setlocale'' claims that ASCII
2238 characters 0 thru 31 are control characters rather than
2239 binary characters. This causes ''less'' to treat some
2240 binary files as ordinary, non-binary files. To workaround
2241 this problem, set the environment variable LESSCHARSET to
2242 ''
2243
2244
2245 See http://www.greenwoodsoftware.com/less for the latest
2246 list of known bugs in this version of less.
2247 !!COPYRIGHT
2248
2249
2250 Copyright (C) 2001 Mark Nudelman
2251
2252
2253 less is part of the GNU project and is free software. You
2254 can redistribute it and/or modify it under the terms of
2255 either (1) the GNU General Public License as published by
2256 the Free Software Foundation; or (2) the Less License. See
2257 the file README in the less distribution for more details
2258 regarding redistribution. You should have received a copy of
2259 the GNU General Public License along with the source for
2260 less; see the file COPYING. If not, write to the Free
2261 Software Foundation, 59 Temple Place, Suite 330, Boston, MA
2262 02111-1307, USA. You should also have received a copy of the
2263 Less License; see the file LICENSE.
2264
2265
2266 less is distributed in the hope that it will be useful, but
2267 WITHOUT ANY WARRANTY; without even the implied warranty of
2268 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2269 GNU General Public License for more details.
2270 !!AUTHOR
2271
2272
2273 Mark Nudelman
2274 Send bug reports or comments to the above address or to
2275 bug-less@gnu.org.
2276 For more information, see the less homepage at
2277 http://www.greenwoodsoftware.com/less.
2278 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.