3 ms·
To support your recommendation and redress the strawman the article postulates, the post's author could have replaced: find . -name '*.log' | xargs rm With:
by AdieuToLogic 3mo ago
To support your recommendation and redress the strawman the article postulates, the post's author could have replaced:
find . -name '*.log' | xargs rm
With:
find . -name '*.log' -print0 | xargs -0 rm
- tjalfi 3mo agoThis one doesn't need xargs. find . -name '*.log' -delete
- sgarland 3mo agoTHANK YOU. I kept nodding along to all of the xargs comments, thinking “sure, but what about the even easier solution?”
- adolph 3mo agoAs well as find has an -exec param to perform things one at a time or all with the same command by using a slash semicolon or a plus sign respectively: #order files from different levels in a file hierarchy by size: find . -type f -maxdepth 1 -exec ls -hlrS {} + #output metadata for each file sequentially find . -type f -maxdepth 1 -exec file {} \;