αғs*_*нιη 19 command-line redirect less
我如何将终端内容(当前我在使用less命令时查看的不是整个文件的内容)重定向到输出文件,直到我按Q退出less?
Syl*_*eau 29
要仅保存当前显示在终端中的部分,您可以使用该|命令。
来自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.
Run Code Online (Sandbox Code Playgroud)
|(管道符号).标记以仅选择终端上可见的内容(或直接点击Enter)tee保存到一个文件,例如:tee /tmp/section_of_big_file.txt带截图的序列:


