[Discuss] xargs guide

John Abreau abreauj at gmail.com
Wed Jul 29 22:59:08 EDT 2015


Looks useful.

I notice a complete absence of the single most important option, though:
-0.

When I use find(1) and xargs(1), by default I always use something like

    find . -xdev ...... -print0 | xargs -0 ....

The -xdev protects against find(1) straying off the current filesystem if
it trips over an unexpected symlink, and the -print0 / -0 disables a lot of
other potential failure modes.


On Wed, Jul 29, 2015 at 9:39 PM, Steve Litt <slitt at troubleshooters.com>
wrote:

> Hi all,
>
> xargs is a gender-changer type program that adapts one program's stdout
> to the next program's command line arguments. It's extremely handy for
> shell scripting, but it can be tricky. I've written a short guide for
> xargs that shows how to get around the usual xargs landmines:
>
> http://www.troubleshooters.com/linux/xargs.htm
>
> Hope you like it.
>
> SteveT
>
> Steve Litt
> July 2015 featured book: Rapid Learning for the 21st Century
> http://www.troubleshooters.com/rl21
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://lists.blu.org/mailman/listinfo/discuss
>



-- 
John Abreau / Executive Director, Boston Linux & Unix
Email: abreauj at gmail.com / WWW http://www.abreau.net / PGP-Key-ID 0x920063C6
PGP-Key-Fingerprint A5AD 6BE1 FEFE 8E4F 5C23  C2D0 E885 E17C 9200 63C6



More information about the Discuss mailing list