0
0

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 3 years have passed since last update.

xargsの-iコマンドについて

Last updated at Posted at 2021-05-21

xargsの-iコマンドは-Iコマンドと同等。
前のコマンドの出力を{}でとることができる。

find . | xargs -i cp {} /dir/name/

下のように引数に対して内容を付け足すこともできる。使い道があるかもしれない。

find . | xargs -i cp {}.png /dir/name/

上から100個のデータを取ってきてコピーしたいとき

ls | head -100 | xargs -i cp {} /dir/name
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?