📄 less.man
字号:
LESS(1) LESS(1)NNAAMMEE less - opposite of moreSSYYNNOOPPSSIISS lleessss --?? lleessss [[--[[++]]aaBBccCCddeeEEffHHiimmMMnnNNqqQQrrssSSuuUUww]] [[--bb _b_u_f_s]] [[--hh _l_i_n_e_s]] [[--jj _l_i_n_e]] [[--kk _k_e_y_f_i_l_e]] [[--{{ooOO}} _l_o_g_f_i_l_e]] [[--pp _p_a_t_t_e_r_n]] [[--PP _p_r_o_m_p_t]] [[--tt _t_a_g]] [[--TT _t_a_g_f_i_l_e]] [[--xx _t_a_b]] [[--yy _l_i_n_e_s]] [[--[[zz]] _l_i_n_e_s]] [[++[[++]]_c_m_d]] [[_f_i_l_e_n_a_m_e]]......DDEESSCCRRIIPPTTIIOONN _L_e_s_s is a program similar to _m_o_r_e (1), but which allows backward movement in the file as well as forward movement. Also, _l_e_s_s does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like _v_i (1). _L_e_s_s uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with an up- arrow.) Commands are based on both _m_o_r_e and _v_i_. Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated.CCOOMMMMAANNDDSS In the following descriptions, ^X means control-X. ESC stands for the ESCAPE key; for example ESC-v means the two character sequence "ESCAPE", then "v". h or H Help: display a summary of these commands. If you forget all the other commands, remember this one. SPACE or ^V or f or ^F Scroll forward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. Warn- ing: some systems use ^V as a special literaliza- tion character. z Like SPACE, but if N is specified, it becomes the new window size. RETURN or ^N or e or ^E or j or ^J Scroll forward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. 1LESS(1) LESS(1) d or ^D Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. b or ^B or ESC-v Scroll backward N lines, default one window (see option -z below). If N is more than the screen size, only the final screenful is displayed. w Like ESC-v, but if N is specified, it becomes the new window size. y or ^Y or ^P or k or ^K Scroll backward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. Warning: some systems use ^Y as a special job control character. u or ^U Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. r or ^R or ^L Repaint the screen. R Repaint the screen, discarding any buffered input. Useful if the file is changing while it is being viewed. F Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.) g or < or ESC-< Go to line N in the file, default 1 (beginning of file). (Warning: this may be slow if N is large.) G or > or ESC-> Go to line N in the file, default the end of the file. (Warning: this may be slow if N is large, or 2LESS(1) LESS(1) if N is not specified and standard input, rather than a file, is being read.) p or % Go to a position N percent into the file. N should be between 0 and 100. (This works if standard input is being read, but only if _l_e_s_s has already read to the end of the file. It is always fast, but not always useful.) { If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. } If a right curly bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. ( Like {, but applies to parentheses rather than curly brackets. ) Like }, but applies to parentheses rather than curly brackets. [ Like {, but applies to square brackets rather than curly brackets. ] Like }, but applies to square brackets rather than curly brackets. ESC-^F Followed by two characters, acts like {, but uses the two characters as open and close brackets, respectively. For example, "ESC ^F < >" could be used to go forward to the > which matches the < in the top displayed line. ESC-^B Followed by two characters, acts like }, but uses the two characters as open and close brackets, respectively. For example, "ESC ^B < >" could be 3LESS(1) LESS(1) used to go backward to the < which matches the > in the bottom displayed line. m Followed by any lowercase letter, marks the current position with that letter. ' (Single quote.) Followed by any lowercase letter, returns to the position which was previously marked with that letter. Followed by another single quote, returns to the position at which the last "large" movement command was executed. Followed by a ^ or $, jumps to the beginning or end of the file respectively. Marks are preserved when a new file is examined, so the ' command can be used to switch between input files. ^X^X Same as single quote. /pattern Search forward in the file for the N-th line con- taining the pattern. N defaults to 1. The pattern is a regular expression, as recognized by _e_d_. The search starts at the second line displayed (but see the -a and -j options, which change this). Certain characters are special if entered at the beginning of the pattern; they modify the type of search rather than become part of the pattern: ! Search for lines which do NOT match the pat- tern. * Search multiple files. That is, if the search reaches the end of the current file without finding a match, the search contin- ues in the next file in the command line list. @ Begin the search at the first line of the first file in the command line list, regard- less of what is currently displayed on the screen or the settings of the -a or -j options. ?pattern Search backward in the file for the N-th line con- taining the pattern. The search starts at the line immediately before the top line displayed. Certain characters are special as in the / command: 4LESS(1) LESS(1) ! Search for lines which do NOT match the pat- tern. * Search multiple files. That is, if the search reaches the beginning of the current file without finding a match, the search continues in the previous file in the com- mand line list. @ Begin the search at the last line of the last file in the command line list, regard- less of what is currently displayed on the screen or the settings of the -a or -j options. ESC-/pattern Same as "/*". ESC-?pattern Same as "?*". n Repeat previous search, for N-th line containing the last pattern. If the previous search was modi- fied by !, the search is made for the N-th line NOT containing the pattern. If the previous search was modified by *, the search continues in the next (or previous) file if not satisfied in the current file. There is no effect if the previous search was modified by @. N Repeat previous search, but in the reverse direc- tion. ESC-n Repeat previous search, but crossing file bound- aries. The effect is as if the previous search were modified by *. ESC-N Repeat previous search, but in the reverse direc- tion and crossing file boundaries. :e [filename] Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the 5LESS(1) LESS(1) previously examined file. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. ^X^V or E Same as :e. Warning: some systems use ^V as a spe- cial literalization character. :n Examine the next file (from the list of files given in the command line). If a number N is specified, the N-th next file is examined. :p Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined. :x Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined. = or ^G or :f Prints some information about the file being viewed, including its name and the line number and byte offset of the bottom line being displayed. If possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line. - Followed by one of the command line option letters (see below), this will change the setting of that option and print a message describing the new set- ting. If the option letter has a numeric value (such as -b or -h), or a string value (such as -P or -t), a new value may be entered after the option letter. If no new value is entered, a message describing the current setting is printed and noth- ing is changed. -+ Followed by one of the command line option letters (see below), this will reset the option to its default setting and print a message describing the new setting. (The "-+_X" command does the same thing as "-+_X" on the command line.) This does not work for string-valued options. 6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -