Linuxコマンド  >  T  >  tee
tee
2009/07/14

tee コマンドは、標準入力を標準出力と指定したファイルに出力してくれるようです。

◆環境
OS Linux 2.6.18-92.el5

tee のバージョンの確認

# tee --version
tee (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the t
erms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>
.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, Richard M. Stallman, and David MacKenzie.

使用例

入力内容を標準出力と tee.out というファイルに出力してみます。

# tee tee.out
tee test    <-入力した内容
tee test    <-teeが出力したもの

出力されたファイル tee.out の内容を確認します。

# cat tee.out
tee test

リダイレクトだと入力内容が標準出力されませんが、tee だと標準出力され、かつ、ファイルにも出力できます。

▲ PageTop  ■ Home


Copyright (C) 2009 ymlib.com