如何log你的command line

terminal开了许多窗口,跑了很多命令,想要把它们记录下来,很笨的方法就是shell-export text as。
但是更简单的方法就是,自动让他记录。
当你打算开始记录一段命令的时候,输入

script screen.log

从现在开始你的一切都将被记录下来到screen.log里面,一直到你结束它
Now, until you stop the script, all input and output in the Terminal will be stored in screen.log.
结束时候,输入

exit

Your screen.log file will stored in the local directory. If you want to redirect it, use an absolute pathname such as~/screen.log. This will do exactly what you are looking for.
查看你的screen.log方法是,

cat screen.log
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容