3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Linux】xargsで引数の位置を指定する方法

Posted at

以下のように記述することで引数の位置を指定できます。

find . -name "*.log" | xargs -i cp {} /exampledir/

以下のようなコマンドが実行されます。

cp ./path/to/sample.log /exampledir/

また以下のように記述しても上記と同様のことが実現できます。

find . -name "*.yml" | xargs -IXXX cp -f XXX ./exampledir/
3
1
0

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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?