Spaces in filenames can be a problem when using find | xargs combination.
To solve this, use:
find . -print0 | xargs -0 <command>
This tells find and xargs to use the ASCII NUL character instead of space to end (separate) the filenames.
Spaces in filenames can be a problem when using find | xargs combination.
To solve this, use:
find . -print0 | xargs -0 <command>
This tells find and xargs to use the ASCII NUL character instead of space to end (separate) the filenames.
May 19, 2009 at 10:13 am |
Nice tip
Nice blog, too.
I’d recommend to split the C/C++ categories, becouse lots of your snipplets are valid in only one of the two languages.
August 10, 2011 at 11:41 am |
Sweet!
December 1, 2011 at 4:14 pm |
Thank you very much for the xargs/find fix for spaces in file names – just saved me hours of man page searching
February 15, 2012 at 1:44 am |
Why don’t use this?
find . | xargs -d “\n” command
I think works in the same manner and its easier to remember.