xargsコマンドの出力は予測されません

xargsコマンドの出力は予測されません

find私がこれを次のように使用したとき:

echo 1 2 3 | xargs  -I{} find {}

次の結果が表示されます。

find: ‘1 2 3’: No such file or directory

しかし、次のように使用すると:

echo 1 2 3 | xargs find

私は次のような結果を得ます。

find: ‘1’: No such file or directory                             
find: ‘2’: No such file or directory          
find: ‘3’: No such file or directory

{}使用時に単一の文字列として扱われるのはなぜですか-I{}

ここに画像の説明を入力してください。

ベストアンサー1

それ記録された機能~のxargs -I

 -I replace-str
              Replace occurrences of replace-str in the initial-
              arguments with names read from standard input.  Also,
              unquoted blanks do not terminate input items; instead the
              separator is the newline character.  Implies -x and -L 1

おすすめ記事