如何用键盘copy/paste把终端的所有内容传到记事本?

How to copy/paste all the contents from terminal to notepad using keyboard?

我 运行 在 'cygwin' 终端中的一个脚本。现在我有超过 10000(10k) 行作为输出。我想使用键盘复制所有内容,就像我们在 Windows

中所做的那样
'ctrl +A' - Select All
'ctrl +c' - Copy
'ctrl +v' - Paste

我知道从头到尾都在进行鼠标悬停。但这是一项艰巨的任务。

如果有什么方法可以实现,请给我建议。

提前致谢。

要将 stderr 和 stdout 输出重定向到一个文件(类似于您在终端上看到的那样),请使用:

mycommand > output_and_error.txt 2>&1

这将从您的 mycommand 获取输出并将其通过管道传输到名为 output_and_error.txt 的文件中,然后您可以在记事本或任何您喜欢的地方打开此文本文件。