我有一台在 centos 7 上运行的服务器。我需要找到一个包含 0774386850 的文件,以便我可以用另一个字符串替换。请给我一个Linux命令给我那个文件
最佳答案
通过grep
命令,你可以达到你的预期
grep -rlnw '/path/to/somewhere/' -e '0774386850'
-r or -R is recursive,
-n is line number, and
-w stands for match the whole word.
-l (lower-case L) file name of matching files.
关于linux - Centos7如何查找包含特定文本的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45544858/