How Can I Delete Files From My Trash Older Than x Months
Just want to see what will be deleted?:
find /Users/username/.Trash/* -mtime +730 -print
Actually delete the files (This can’t be undone):
find /Users/username/.Trash/* -mtime +730 -exec rm -f {} \;
Keep in mind, you must substitute ’username’ with your actual username.
find/Users/username/.Trash/* finds all the files in the given directory
-mtime +730 finds files modified greater than 730 days ago.
-print prints the files found to the output (shell screen)
-exec rm -f {} \; executes the command rm with -f flag to force on the file found {}. \; stops the command.
Tested and working 5/1/09 on OS X 10.5.6
