-
-
Save franklinharvey/074151c36fff113414fc185c63c3862c to your computer and use it in GitHub Desktop.
Force empty Trash after placing Time Machine backups in trash, for all volumes in OSX (including connected drives).
This file contains hidden or 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 | |
#### Created by Jean-Pierre Fourie | |
#### Editted by Franklin Harvey | |
### https://github.com/emotality | |
### https://github.com/franklinharvey | |
## force_empty_trash.sh | |
# | |
clear | |
echo " " | |
echo " ####################################################### " | |
echo " ################## FORCE EMPTY TRASH ################## " | |
echo " ####################################################### " | |
echo " " | |
echo " ** Note: This will permanently delete all your volumes' Trash, along with Time Machine Backups that are in Trash. **" | |
echo " " | |
read -p " Force empty all your Trash? [y/n]: " answer | |
case "$answer" in | |
y|Y ) sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass rm -rfv /Volumes/*/.Trashes;; | |
n|N ) echo "Exiting \n"; exit;; | |
* ) echo "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