This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
如果您想要终端历史记录的全部内容:
在 gnome-terminal 菜单中,Edit >选择全部,然后编辑>复制。 (或者使用您最喜欢的键盘快捷键进行复制。)
然后粘贴到任意位置。
如果您只需要历史记录的一部分,请用鼠标选择然后复制。
If you want the whole contents of the terminal history:
In the gnome-terminal menu, Edit > Select All and then Edit > Copy. (Or use your favorite keyboard shortcut for the copy.)
Then paste anywhere.
If you want just part of the history, select with your mouse and then copy.
您可以使用 unix script 命令来捕获内容。
You could use the unix script command to capture things as you go.
如果您想要捕获和解析程序的输出,只需将其重定向 (
>
) 到文件中,然后解析它即可。如果您还需要标准错误,请在其中附加
2>&1
。如果您想要屏幕截图(即包括输入),请使用 script 程序。
If it's the output of a program that you want to capture and parse, simply redirect (
>
) it into a fileand then parse it. Append a
2>&1
to that if you want standard error as well.If you want a screen capture (i.e. including input), use the script program.
您可能想使用“tee”命令。 Tee 将 stdout 分叉并将输出复制到文件中。这样您就可以看到输出并存储输出。示例:
ls |发球台 ls_out
You may want to use the 'tee' command. Tee bifurcates out stdout and makes a copy out the output in a file. So you can see the output and have the output stored also. Example:
ls | tee ls_out