我的操作系统是:Centos Desktop。
我想搜索一个文本字符串
在目录中的任何文件中
/usr/test/
grep 'regex' -r /usr/test 试试看
试试 grep string -r /usr/test
将搜索 /usr/test 和所有子目录
使用 grep
你可以看看grep的文档
看一个简单的例子
https://superuser.com/questions/268190/how-to-grep-or-find-exactly-what-i-am-looking-for
grep "你的文本" -r /usr/test
或cd到/usr/test然后 " grep "你的文本" *.fileExtension "
只需使用您的字符串 grep 目录