Putting rm -rf in a script is always a bad idea

Today I found myself typing this.

for x in `find ~/Library/Developer/CoreSimulator/Devices -maxdepth 1 -mtime +60d`; do rm -rf $x; done


It saved me a ton of disk space but … i could easily have blitzed something important using rm -rf. Maybe it would have been safer to move them into ~/.Trash instead.

Leave a Reply

Your email address will not be published.