Skip to content

Instantly share code, notes, and snippets.

@emotality
Created July 7, 2015 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save emotality/4019743a45001619ba0f to your computer and use it in GitHub Desktop.
Save emotality/4019743a45001619ba0f to your computer and use it in GitHub Desktop.
Force empty Trash for all volumes in OSX.
#!/bin/bash
#### Created by Jean-Pierre Fourie
### https://github.com/emotality
## force_empty_trash.sh
#
clear
echo " "
echo " ####################################################### "
echo " ################## FORCE EMPTY TRASH ################## "
echo " ####################################################### "
echo " "
echo " ** Note: This will permanently delete all your volumes' Trash. **"
echo " "
read -p " Force empty all your Trash? [y/n]: " answer
case "$answer" in
y|Y ) sudo rm -rf ~/.Trash; sudo rm -rf /Volumes/*/.Trashes;;
n|N ) echo " Then what are we doing here? \n"; exit;;
* ) echo " Invalid option.. Exiting. \n"; exit;;
esac
echo " Your Trash has been emptied! \n"
killall Dock
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment