Created
October 18, 2016 12:05
-
-
Save m4scosta/f67d716124925198baf9f74e9946a146 to your computer and use it in GitHub Desktop.
Fast delete recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOT=$1 | |
for dir in $(find $ROOT* -maxdepth 5 -type d | sort -z); do | |
echo "Deleting $dir" | |
cd $dir | |
perl -e 'for(<*>){((stat)[9]<(unlink))}' | |
cd .. | |
rm -r $dir | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment