將輸出寫入 stdout 以及檔案

以下命令僅在螢幕(stdout)上顯示輸出。

$ ls 

以下命令僅將輸出寫入檔案而不是螢幕。

$ ls > file

以下命令(在 tee 命令的幫助下)將輸出寫入螢幕(標準輸出)和檔案。

$ ls | tee file