开发者

Dump terminal session to file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_JS百科

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 9 years ago.

Improve this question

I run gnome-terminal with unlimited scroll-line history

I want to dump text I can see in terminal to file and parse it

Is there a way to do it?


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.


You could use the unix script command to capture things as you go.


If it's the output of a program that you want to capture and parse, simply redirect (>) it into a file

program_with_lots_of_output > output.log

and 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜