Skip to content

Instantly share code, notes, and snippets.

@zhangyangjing
Created November 6, 2014 02:14
Show Gist options
  • Save zhangyangjing/ba7a20d31ad1d7060d70 to your computer and use it in GitHub Desktop.
Save zhangyangjing/ba7a20d31ad1d7060d70 to your computer and use it in GitHub Desktop.
clear mac ._* bash shell
#!/bin/sh
#find . -name "._*" -exec rm {} \;
function clear() {
for file in `ls -A $1`
do
if [ -d $1/$file ]
then
clear $1/$file
else
if [[ $file = ._* ]]
then
echo rm$1/$file
fi
fi
done
}
clear $PWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment