ign*_*des 4 command-line screen less
从less或退出后more,屏幕内容恢复到原来的状态。这发生在寻呼机(如less/ more)和其他一些命令中。有时需要在退出命令后保留屏幕内容。
我怎样才能使退出程序之前立即显示的文本在终端中保持可见?
您可以使用 -X 开关:
-X or --no-init
Disables sending the termcap initialization and deinitialization strings to the terminal.
This is sometimes desirable if the deinitialization string does something unnecessary, like
clearing the screen.
Run Code Online (Sandbox Code Playgroud)
或者,您可以执行以下操作:
例如cat myfile,显示整个文件或cat myfile | grep searchterm要搜索特定内容。
您还可以使用head -n X或tail-n X来显示文件的第一/最后 X 行。