HowtoMatrix

Lot of HOWTOs

August 30th, 2008

The Joys of xargs

Tricks, by suvi.

xargs is an incredibly useful command: it takes in input and executes your chosen command on it: xargs command. Deceptively simple in concept; extremely powerful in execution. It’s most commonly used to execute one command on the output from another command (command1 | xargs command2), and most often the output-generating command is find (xargs is more flexible than the built-in -exec option). Here we’ll look at xargs with find, and then at some other possibilities.

A couple of options which are useful for testing: -t echoes the command before executing it, and -p echoes it and asks for confirmation.

Read more at LinuxPlanet

Back Top

Leave a Reply

Your email address will not be published. Required fields are marked *


*

Featuring YD Feedwordpress Content Filter Plugin