3 ms·
I would have expected an article on how to use these tools "like a boss" to point out that if there is whitespace in the filenames you will run into problems un
by saurik 15y ago
I would have expected an article on how to use these tools "like a boss" to point out that if there is whitespace in the filenames you will run into problems unless you use "find ... -print0 | xargs -0 ...".
- masklinn 15y agoWhat I'd have expected in an article on how to use this tool is talk about `-exec` and `-exec +` before shooting straight for xargs.
- barrkel 15y agoI very rarely use find -exec, because I usually want to massage the list of files further. So I have a simple utility, print0, which reads lines and outputs null-terminated lines. It turns any list separated with newlines into input suited to xargs -0. File names with embedded newlines are vanishingly rare, compared to those with spaces, so it has always worked out well for me.