サーバーのよく使うコマンドメモ| tee

2016年2月28日

コマンド サーバー テクノロジー

Summery

ファイルの書き込みを行う ターゲットのファイルがない場合は自動作成される。

Construction

$tee [option] [target-file]

Option

-a : 追記モード

Sample

## hoge.txtに「hoge-hoge」を書き込む $ echo "hoge-hoge"|tee hoge.txt ##結果 $ cat hoge.txt hoge-hoge ## hoge.txtに追記する $ echo "foo-foo"|tee -a hoge.txt ##結果 $ cat hoge.txt hoge-hoge foo-foo ## 既存のhoge.txtを上書きする $ echo "not-append"|tee hoge.txt ##結果 $ cat hoge.txt not-append

Discription

TEE(1) BSD General Commands Manual TEE(1) NAME tee -- pipe fitting SYNOPSIS tee [-ai] [file ...] DESCRIPTION The tee utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered. The following options are available: -a Append the output to the files rather than overwriting them. -i Ignore the SIGINT signal. The following operands are available: file A pathname of an output file. The tee utility takes the default action for all signals, except in the event of the -i option. The tee utility exits 0 on success, and >0 if an error occurs. STANDARDS The tee function is expected to be POSIX IEEE Std 1003.2 (``POSIX.2'') compatible. BSD June 6, 1993 BSD

このブログを検索

ごあいさつ

このWebサイトは、独自思考で我が道を行くユゲタの少し尖った思考のTechブログです。 毎日興味がどんどん切り替わるので、テーマはマルチになっています。 もしかしたらアイデアに困っている人の助けになるかもしれません。