搜索代码库中特定单词的最佳工具或方法是什么?

Cor*_*use 2 search command-line replace

您建议在代码中查找和替换值的工具或方法是什么?如果代码在Linux/Unix上,那么找到最好的方法吗?

And*_*ter 7

看看ack,它是专为搜索大型代码库而设计的.

要进行替换,请查看Perl的-i,-p和-e标志.你可以这样做:

$ perl -i -p -e's/\bthisword\b/thatword/g' $(find . -name *.html)
Run Code Online (Sandbox Code Playgroud)

在树中的所有.html文件中用thisword替换thisword的所有实例.