Created
July 7, 2015 21:15
-
-
Save emotality/a3a5b7fcc62e5075a105 to your computer and use it in GitHub Desktop.
Delete all .DS_Store files in OSX.
This file contains 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 | |
### https://github.com/emotality | |
## delete_ds_store.sh | |
# | |
clear | |
echo " " | |
echo " ########################################################## " | |
echo " #################### DELETE .DS_STORE #################### " | |
echo " ########################################################## " | |
echo " " | |
echo " ** Note: Make sure the script is in the upper directory where you want to" | |
echo " delete the .DS_Store files in all the lower directories." ** | |
echo " ** Note: Close all Finder windows. **" | |
echo " " | |
CURRENT_PATH="`dirname \"$0\"`" | |
cd "$CURRENT_PATH" | |
var=$(pwd) | |
echo " The current working directory is: '$var'" | |
echo " " | |
read -p " Delete all .DS_Store files in this and all sub-directories? [y/n]: " answer | |
case "$answer" in | |
y|Y ) find . -name ".DS_Store" -print0 | xargs -0 rm -rf; echo " All .DS_Store files has been deleted \n";; | |
n|N ) echo " Then what are we doing here? \n";; | |
* ) echo " Invalid option.. Exiting. \n";; | |
esac | |
killall Finder | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment