Delete files above a certain size with xargs + other find recipes

categories:

Delete files in the current directory above 500Kb find -size +500 | xargs rm

This may not work on files with spaces in their filename. Use the solution recommended in the comments.

Other recipes :

Change the permissions and set 750 on dirs and 0640 on files:

find -type d -exec chmod 0750 '{}' ';' find -type f -exec chmod 0640 '{}' ';'




Thanks for reading this post!


Did you find an issue in this article?

- click on the following Github link
- log into Github with your account
- click on the line number containing the error
- click on the "..." button
- choose "Reference in new issue"
- add a title and your comment
- click "Submit new issue"

Your feedback is much appreciated! πŸ€œπŸΌπŸ€›πŸΌ

You can also drop me a line below!