3 ms·
But that's exactly it - if any of the filenames have spaces, that will fail, since xargs will try to delete each part separately. From the man page: Because Un
by icebraining 11y ago
But that's exactly it - if any of the filenames have spaces, that will fail, since xargs will try to delete each part separately. From the man page:
Because Unix filenames can contain blanks and newlines, this default behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs.
- johnwfinigan 11y agoExcluding filenames containing newlines, I wonder how many weird corner cases this would reveal: ls | tr '\n' '\0' | xargs -0 rm I've been annoyed by ls and xargs not playing together here and there, but the above only just occurred to me. Not sure if it's a good idea yet or not!