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


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!

If you found an issue in this article, you can create an issue on Github.

If you have a comment or question, please drop me a line below!