Answers:
要仅保存终端中当前显示的部分,可以使用|
命令。
来自man less
:
| <m> shell-command
<m> represents any mark letter. Pipes a section of the input file to the given
shell command. The section of the file to be piped is between the first line on the
current screen and the position marked by the letter. <m> may also be '^' or '$' to
indicate beginning or end of file respectively.
If <m> is '.' or newline, the current screen is piped.
|
(管道符号).
标记以仅选择终端上可见的内容(或点击Enter)tee
保存到一个文件,例如:tee /tmp/section_of_big_file.txt
屏幕截图的顺序:
cat foo | less -o bar
这里bar
是输出文件和foo
输入文件?