Nice to know, thanks! But, how does it work with file names containing spaces (or other strange characters)?
Edit: just to clarify: my question concerns the zsh method. Regarding find+xargs, I wrote that comment :-)
Actually, this edit would be an answer to zap; HN does not let me reply directly to him: is it to prevent flame-wars?
Thats what the print0 arg in find and the --null arg in xargs are for.
print0 prints the file name followed by a NULL character (rather than newline)
Using the --null/-0 arg makes xargs look for NULLs as delimiters and treat everything else literally.
Comments
Nice to know, thanks! But, how does it work with file names containing spaces (or other strange characters)?
Edit: just to clarify: my question concerns the zsh method. Regarding find+xargs, I wrote that comment :-) Actually, this edit would be an answer to zap; HN does not let me reply directly to him: is it to prevent flame-wars?
Thats what the print0 arg in find and the --null arg in xargs are for.
print0 prints the file name followed by a NULL character (rather than newline) Using the --null/-0 arg makes xargs look for NULLs as delimiters and treat everything else literally.