SEARCHING - 搜索
/pattern * Search forward for (N-th) matching line.
- 向前搜索第n个匹配行。
?pattern * Search backward for (N-th) matching line.
- 向后搜索第n个匹配行。
n * Repeat previous search (for N-th occurrence).
- 重复前面的搜索(针对第n次出现)。
N * Repeat previous search in reverse direction.
- 反向重复前面的搜索。
ESC-n * Repeat previous search, spanning files.
- 重复前面的搜索,生成文件。
ESC-N * Repeat previous search, reverse dir. & spanning files.
- 重复前面的搜索,反向目录。并生成文件。
ESC-u Undo (toggle) search highlighting.
- 撤销(切换)搜索高亮显示。
&pattern * Display only matching lines
- 只显示匹配行
---------------------------------------------------
A search pattern may be preceded by one or more of:
一个搜索模式的前面可以有一个或多个:
^N or ! Search for NON-matching lines.
- 搜索不匹配的线。
^E or * Search multiple files (pass thru END OF FILE).
- 搜索多个文件(通过文件的结尾)。
^F or @ Start search at FIRST file (for /) or last file (for ?).
- 从第一个文件(for /)或最后一个文件(for ?)开始搜索。
^K Highlight matches, but don't move (KEEP position).
- 高亮匹配,但不要移动(保持位置)。
^R Don't use REGULAR EXPRESSIONS.
- 不要使用正则表达式。
---------------------------------------------------------------------------
JUMPING - 跳转
g < ESC-< * Go to first line in file (or line N).
- 转到文件的第一行(或第N行)。
G > ESC-> * Go to last line in file (or line N).。
- 转到文件的最后一行(或第N行)。
p % * Go to beginning of file (or N percent into file).
- 转到文件的开头(或N %进入文件)。
t * Go to the (N-th) next tag.
- 到第n个标签。
T * Go to the (N-th) previous tag.
- 转到前面的(n个)标签。
{ ( [ * Find close bracket } ) ].
- 发现右括号
} ) ] * Find open bracket { ( [.
- 发现左括号
ESC-^F <c1> <c2> * Find close bracket <c2>.
- 发现右括号
ESC-^B <c1> <c2> * Find open bracket <c1>
- 发现左括号
---------------------------------------------------
Each "find close bracket" command goes forward to the close bracket
matching the (N-th) open bracket in the top line.
- 每个“查找右括号”命令都将前进到与第n个左括号相匹配的右括号。
Each "find open bracket" command goes backward to the open bracket
matching the (N-th) close bracket in the bottom line.
- 每个“查找左括号”命令将返回到与底线(第n个)右括号匹配的左括号。
m<letter> Mark the current position with <letter>.
- 用<letter>标记当前位置
'<letter> Go to a previously marked position.
- 转到先前标记的位置。
'' Go to the previous position.
- 回到以前的位置。
^X^X Same as '.
- 和'.一样
---------------------------------------------------
A mark is any upper-case or lower-case letter.
Certain marks are predefined:
标记是任何大写或小写字母。某些标记是预定义的:
^ means beginning of the file
^ 意思是一个文件的开头
$ means end of the file
$ 意思是一个文件的结尾
---------------------------------------------------------------------------
CHANGING FILES - 修改文件
:e [file] Examine a new file.
- 检查一个新文件。
^X^V Same as :e.
- 和:e.一样
:n * Examine the (N-th) next file from the command line.
- 从命令行检查下一个文件。
:p * Examine the (N-th) previous file from the command line.
- 从命令行检查前面的(第n个)文件。
:x * Examine the first (or N-th) file from the command line.
- 检查命令行中的第一个(或第n个)文件。
:d Delete the current file from the command line list.
- 从命令行列表中删除当前文件。
= ^G :f Print current file name.
- 打印当前文件名。
---------------------------------------------------------------------------
MISCELLANEOUS COMMANDS - 各种各样的命令
-<flag> Toggle a command line option [see OPTIONS below].
- 切换命令行选项[参见下面的选项]。
--<name> Toggle a command line option, by name.
- 按名称切换命令行选项。
_<flag> Display the setting of a command line option.
- 显示命令行选项的设置。
__<name> Display the setting of an option, by name.
- 按名称显示选项的设置。
+cmd Execute the less cmd each time a new file is examined.
- 每次检查新文件时执行less cmd。
!command Execute the shell command with $SHELL.
- 使用$ shell执行shell命令。
|Xcommand Pipe file between current pos & mark X to shell command.
- 管道文件之间的当前pos和标记X shell命令。
s file Save input to a file.
- 将输入保存到文件中。
v Edit the current file with $VISUAL or $EDITOR.
- 用$VISUAL或$EDITOR编辑当前文件。
V Print version number of "less".
- 打印“less”版本号。
---------------------------------------------------------------------------
OPTIONS - 选项
Most options may be changed either on the command line,
or from within less by using the - or -- command.
大多数选项可以在命令行上更改,也可以通过使用 - or -- 命令从内部更改。
Options may be given in one of two forms: either a single
character preceded by a -, or a name preceded by --.
选项可能以两种形式之一给出:单个字符前加 --,或名称前加 -。
-? ........ --help
Display help (from command line).
-a ........ --search-skip-screen
Search skips current screen.
-A ........ --SEARCH-SKIP-SCREEN
Search starts just after target line.
-b [N] .... --buffers=[N]
Number of buffers.
-B ........ --auto-buffers
Don't automatically allocate buffers for pipes.
-c ........ --clear-screen
Repaint by clearing rather than scrolling.
-d ........ --dumb
Dumb terminal.
-D [xn.n] . --color=xn.n
Set screen colors. (MS-DOS only)
-e -E .... --quit-at-eof --QUIT-AT-EOF
Quit at end of file.
-f ........ --force
Force open non-regular files.
-F ........ --quit-if-one-screen
Quit if entire file fits on first screen.
-g ........ --hilite-search
Highlight only last match for searches.
-G ........ --HILITE-SEARCH
Don't highlight any matches for searches.
-h [N] .... --max-back-scroll=[N]
Backward scroll limit.
-i ........ --ignore-case
Ignore case in searches that do not contain uppercase.
-I ........ --IGNORE-CASE
Ignore case in all searches.
-j [N] .... --jump-target=[N]
Screen position of target lines.
-J ........ --status-column
Display a status column at left edge of screen.
-k [file] . --lesskey-file=[file]
Use a lesskey file.
-K --quit-on-intr
Exit less in response to ctrl-C.
-L ........ --no-lessopen
Ignore the LESSOPEN environment variable.
-m -M .... --long-prompt --LONG-PROMPT
Set prompt style.
-n -N .... --line-numbers --LINE-NUMBERS
Don't use line numbers.
-o [file] . --log-file=[file]
Copy to log file (standard input only).
-O [file] . --LOG-FILE=[file]
Copy to log file (unconditionally overwrite).
-p [pattern] --pattern=[pattern]
Start at pattern (from command line).
-P [prompt] --prompt=[prompt]
Define new prompt.
-q -Q .... --quiet --QUIET --silent --SILENT
Quiet the terminal bell.
-r -R .... --raw-control-chars --RAW-CONTROL-CHARS
Output "raw" control characters.
-s ........ --squeeze-blank-lines
Squeeze multiple blank lines.
-S ........ --chop-long-lines
Chop (truncate) long lines rather than wrapping.
-t [tag] .. --tag=[tag]
Find a tag.
-T [tagsfile] --tag-file=[tagsfile]
Use an alternate tags file.
-u -U .... --underline-special --UNDERLINE-SPECIAL
Change handling of backspaces.
-V ........ --version
Display the version number of "less".
-w ........ --hilite-unread
Highlight first new line after forward-screen.
-W ........ --HILITE-UNREAD
Highlight first new line after any forward movement.
-x [N[,...]] --tabs=[N[,...]]
Set tab stops.
-X ........ --no-init
Don't use termcap init/deinit strings.
-y [N] .... --max-forw-scroll=[N]
Forward scroll limit.
-z [N] .... --window=[N]
Set size of window.
-" [c[c]] . --quotes=[c[c]]
Set shell quote characters.
-~ ........ --tilde
Don't display tildes after end of file.
-# [N] .... --shift=[N]
Horizontal scroll amount (0 = one half screen width)
........ --no-keypad
Don't send termcap keypad init/deinit strings.
........ --follow-name
The F command changes files if the input file is renamed.
........ --use-backslash
Subsequent options use backslash as escape char.
---------------------------------------------------------------------------
LINE EDITING - 行编辑
These keys can be used to edit text being entered
on the "command line" at the bottom of the screen.
- 这些键可以用来编辑在屏幕底部的“命令行”上输入的文本。
RightArrow ..................... ESC-l ... Move cursor right one character.
LeftArrow ...................... ESC-h ... Move cursor left one character.
ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word.
ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word.
HOME ........................... ESC-0 ... Move cursor to start of line.
END ............................ ESC-$ ... Move cursor to end of line.
BACKSPACE ................................ Delete char to left of cursor.
DELETE ......................... ESC-x ... Delete char under cursor.
ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor.
ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor.
ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line.
UpArrow ........................ ESC-k ... Retrieve previous command line.
DownArrow ...................... ESC-j ... Retrieve next command line.
TAB ...................................... Complete filename & cycle.
SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle.
ctrl-L ................................... Complete filename, list all.
gitlog操作
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 表达式 表达式与数学中的定义相似,表达式是指具有一定的值、用操作符把常数和变量连接起来的代数式。一个表达式可以包含...
- 通过js对网页进行换肤: window.onload=function () { var link1 =docum...
- 1、数据库:存储数据的仓库、高效地存储和处理数据的介质(介质主要是两种:磁盘和内存) 分类:基于存储介质的不同:分...
- 相等运算符 相等运算符用来比较两个值是否相等, 如果相等会返回true,否则返回false 使用 == 来做相等运...
- 1、数据库:存储数据的仓库、高效地存储和处理数据的介质(介质主要是两种:磁盘和内存) 分类:基于存储介质的不同:分...