標準出力とログに同時に出力

以下のようにteeコマンドを使用する

ls -l | tee -a file.log

 -a オプションはファイルに追記
最終更新:2014年01月26日 12:45