简体   繁体   中英

Using linux “tee” command in bashrc

如何在bashrc中使用linux“ tee”命令自动记录您在shell中编写的所有内容,并在屏幕上与somefile并行显示?

Assuming you just want to record your shell session in a file, the easiest way is:

script mylog

It just opens a new shell. When you want to stop session recording, just type exit . After that, your recorded session will be in mylog file.


Alternatively you can do:

$ tee > mylog

And on another window:

$ tail -f mylog

But this is probably not what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM