前几天移动项目想要放到另外一个版本控制平台, 结果发现大量的.svn污染整个目录... 之前公司有个同事用python写了个脚本用于清理..., 想了下, 如果单在linux下使用直接用shell就足够了.. 遂写了个...
#!/bin/sh #remove appoint dir all the .svn if [ $# != 1 ]; then echo "must input clean dir"; else find $1 -name "*.svn" > svn.dir list=`cat svn.dir` for one in $list do rm -rf $one done rm -f svn.dir echo "clean $1 all the .svn dir complete"; fi
用着感觉挺好~ :)