How can I get `find` to ignore .svn directories?

后端 未结 20 1522
迷失自我
迷失自我 2020-12-04 05:05

I often use the find command to search through source code, delete files, whatever. Annoyingly, because Subversion stores duplicates of each file in its .

20条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-04 05:46

    why not just

    find . -not -iwholename '*.svn*'
    

    The -not predicate negates everything that has .svn anywhere in the path.

    So in your case it would be

    find -not -iwholename '*.svn*' -name 'messages.*' -exec grep -Iw uint {} + \;
    

提交回复
热议问题