タグ

ブックマーク / ike-dai.hatenablog.com (1)

  • リダイレクション - ike-dai's blog

    Linuxの勉強会で得た知識を少し紹介。 リダイレクションの不思議な挙動についてです。 $ echo "test" > file $ cat file test $ echo "test2" >> file $ cat file test test2 これはよく使う感じです。 上記2つのリダイレクションについては、標準出力の内容をfileに書き出すという処理です。 標準エラー出力を記録したい場合は次のようにします。 $ ls -la hoge ls: cannot access hoge: No such file or directory $ ls -la hoge 2> error $ cat error ls: cannot access hoge: No such file or directory では、同じファイルに標準出力と標準エラー出力の両方を書き出す場合はどうすればいいの

    リダイレクション - ike-dai's blog
  • 1