mathr / blog / #

xargs is handy

Frustrated that many shell commands don't work with wildcards? Fear not, xargs is the solution!

Here is not how to unzip a load of zip files:

$ unzip *.zip
Archive:  a.zip
caution: filename not matched:  b.zip
caution: filename not matched:  c.zip
...

xargs to the rescue! Now you can unzip all of your zips with no fuss!

$ find *.zip -print0 | xargs --null -n 1 -iX unzip "X"
Archive: a.zip
   creating: a/
 extracting: a/a1.txt
 extracting: a/a2.txt
 ...
Archive: b.zip
   creating: b/
 extracting: b/b1.txt
 extracting: b/b2.txt
 ...
...

Roni Size and Reprazent - New Forms - Watching Windows

motherboard 6 wires