Sunday, October 7. 2007xargsTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
pkill -9 nobody an appropriate xargs example would be: There’s always another and frequently shorter way… I was just illustrating the concept for the related blog post with a for loop in place of xargs. For your example you could do this on linux: Also, on Linux (or any system that uses the GNU find and GNU xargs), you can use find . -type f -print0 | xargs -0 do_something_useful The -print0 causes the files to be printed separated by null characters instead of new lines, -0 expects the incoming data to be separated by null characters. This is good for places where you might have file names with embedded spaces, since otherwise xargs won’t pass the filename on to do_something_useful correctly. |
Search This BlogPlanet Sysadmin FeedChris Siebenmann: Go, IPv6, and single binding machines
Thursday, September 9. 2010 Ubuntu Geek: ExpoSong 0.7 released! Wednesday, September 8. 2010 mypapit gnu/linux blog: How to use GNU Privacy Guard (GPG) – Encrypt, Decrypt, Sign and Verifying identities Wednesday, September 8. 2010 Sam Ruby: MPL Alpha 2 Wednesday, September 8. 2010 Simplehelp: How to save documents created in Pages as Microsoft Word (.doc) files Wednesday, September 8. 2010 Disclaimer"This blog is my own and does not represent the positions, strategies or opinions of my employer or anyone else." --Joe This work is licensed under a Creative Commons Attribution Noncommercial Share Alike 3.0 License. |