Created
May 31, 2012 18:54
-
-
Save KhasMek/2845401 to your computer and use it in GitHub Desktop.
find and remove all occurrences of a file easily... I'm so lazy.
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 | |
name=${1} | |
location=${2} | |
if [ ! "$location" ]; then | |
location=. | |
fi | |
find $location -name $name | while read line | |
do | |
rm -rf "$line" | |
done | |
echo "all occurances of $name in $location deleted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment