Skip to content

tee(LPIC)

   

tee

標準入力から読み込んだデータ尾を標準出力とファイルの両方に出力するコマンドです。

サンプル

pokemons.txt を行番号付きで読み込み、pokemons-with-line.txt に保存し、最初の2行を表示する。

$ cat -n pokemons.txt | tee pokemons-with-line.txt | head -2
     1	snorlax
     2	ditto

関連記事

  1. リダイレクト(LPIC)
  2. cat(LPIC)
  3. less(LPIC)
  4. more(LPIC)
  5. xz,unxz(LPIC)
  6. bzip2,bunzip2(LPIC)
  7. gzip, gunzip(LPIC)