Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将命令的输出重定向到一个文件,但仍保持输出在终端上回显?
我希望输出到一个文件,但我仍然想在终端上看到它(只是让我知道发生了什么事)
是的,tee做你想要的:
tee
command | tee output.log
您可以使用“tee”,即
ls -ltr | tee -a mylog.log