回答:
-pまたは-tフラグから恩恵を受けることができます。
xargs -p または xargs --interactive、実行するコマンドを出力し、コマンドを実行する前に確認のために入力を促します(y / n)。
% cat list
one
two
three
% ls
list
% cat list | xargs -p -I {} touch {}
touch one ?...y
touch two ?...n
touch three ?...y
% ls
list
one
three
xargs -tまたはxargs --verbose、各コマンドを出力して、すぐに実行します:
% cat list | xargs -t -I {} touch {}
touch one
touch two
touch three
% ls
list
one
three
two
-pと-tオプションの素晴らしい答え。優れた例。ありがとうございました!