简体   繁体   中英

linux terminal: how to copy output to a file and print at terminal simultaneously?

I would like to save output from command to a file and observe it on ubuntu terminal at once.

Using basic:

command >output.txt

It's not working, because the terminal shows nothing.

Is it possible to see the output in both file and in terminal window?

使用tee命令可以实现相同的目的。

command | tee output.txt

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