tee命令可以做到这一点: 例:ls -al /home | tee log 就可以把命令输出的内容显示在屏幕上的同时也输出至文件log。 转载于:https://www.cnblogs.com/SunOne/p/5229612.html