bash oneliner在常见网站文件中查找字符串
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了bash oneliner在常见网站文件中查找字符串相关的知识,希望对你有一定的参考价值。
I use this bash oneliner all the time to recursively search for a string in large codebases. I use it when searching for mentions of tables, databases, function definitions, function calls etcetera. It searches through a number of file types (.js .php .class .inc .html .htm .css) and skips all the others, which speeds up the search if the codebase contains large non-code files. You can add or delete filetypes to adapt it to your needs, you can probably figure out the syntax by looking at the current code. You can add your own fi
find . -type f ( -name "*.js" -o -name "*.php" -o -name "*.class" -o -name "*.inc" -o -name "*.html" -o -name "*.htm" -o -name "*.css" ) -exec grep -il 'needleString' {} ;
以上是关于bash oneliner在常见网站文件中查找字符串的主要内容,如果未能解决你的问题,请参考以下文章
如果 bash 命令的状态在某个范围内,则 Oneliner 用于失败
sh bash快捷方式,用于在指定目录下的所有文件中查找和替换字符串