find ./ -type l -exec rm -f {} \;
Find can execute arguments with the -exec option for each match it finds. It is a recommended mechanism because you can handle paths with spaces/newlines and other characters in them correctly. You will have to delete the contents of the directory before you can remove the directory itself, so use -r with the rm command to achieve this.
delete all .svn:
find . -name ".svn" -exec rm -r "{}" \;
You can also tell find to just find directories named .svn by adding a -type d check:
find . -name ".svn" -type d -exec rm -r "{}" \;
Warning Use rm -r with caution it deletes the folder and all its contents.
If you want to delete just empty directories as well as directories that contain only empty directories, find can do that itself with -delete and -empty:
find . -name ".svn" -type d -empty -delete
find ./ -name \* -type f -print | xargs grep "connect_to_service"
阅读(974) | 评论(0) | 转发(0) |