terminal
Welcome to Linux Practice Terminal!
Type "help" to see available commands.
user@linux:~$
tee - 出力の分岐
teeを使って出力を画面とファイルに同時に送る方法を学びます。
ステップ 1
teeを使って"hello"をoutput.txtに書き込みながら画面にも表示しましょう。
入力: echo hello | tee output.txt
echo hello | tee output.txt
ステップ 2
catでoutput.txtを読んでファイルが作成されたことを確認しましょう。
ステップ 3
tee -a(追記モード)を使って"world"をoutput.txtに追加しましょう。
ステップ 4
output.txtを確認して両方の行があることを検証しましょう。