Skip to content

Instantly share code, notes, and snippets.

@Salman-Shaik
Last active April 14, 2021 22:57
Show Gist options
  • Save Salman-Shaik/74492800c5fbd6b1c73b1a2268bd98ef to your computer and use it in GitHub Desktop.
Save Salman-Shaik/74492800c5fbd6b1c73b1a2268bd98ef to your computer and use it in GitHub Desktop.
Pendrive Trash Cleaner in Mac

Steps to Follow:

  • Download the file clearTrashFromPendrive.sh
  • Connect Pendrive to your mac
  • Make sure pendrive is working
  • Run sh clearTrashFromPendrive.sh "PENDRIVE_NAME" command in Terminal from the directory where you have downloaded the file.
  • That's it You're Done.
CURR_DIR=$(pwd)
if [[ $1 ]]; then
cd /VOLUMES/$1
if [[ $? != 0 ]]; then
echo 'File Not Found'
exit
fi
echo 'Found Device '$1
rm -rf .Trashes
echo 'Clean Completed'
cd $CURR_DIR
exit
fi
echo 'Filename Was Not Mentioned.Try Again.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment