LoginSignup
0
0

More than 1 year has passed since last update.

【Linux】パイプ、リダイレクトとは?

Posted at

パイプ

あるコマンドの標準出力を、別のコマンドの標準入力に渡す機能。

使い方

file1内の「abc」という文字列を「cdf」に置換する場合、下記の様に実行する。

cat file1 | tr [abc] [cdf]

リダイレクト

あるコマンドの標準出力を画面ではなくファイルに出力する。または、ファイルをあるコマンドの標準入力に渡す。

使い方

パイプの紹介時と同様に、file1内の「abc」という文字列を「cdf」に置換する場合、下記の様に実行する。

tr [abc] [cdf] < file1
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0