Linux

xargs

CautionBuild & run command lines

... | xargs <command>

Turns stdin into arguments. The workhorse for bulk ops with find. -I{} places args; -P parallelizes.

Examples

  • find . -name '*.log' -mtime +30 | xargs rm -fBulk-delete old logs

Syntax

xargs [-I{}] [-P n] <command>

Before you run it

Combined with rm it bulk-deletes — verify targets first.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store