如何在Centos7中查找包含特定文本的文件?

Pet*_*tai 4 linux centos7

我有一台在centos 7上运行的服务器。我需要找到一个包含0774386850的文件,以便可以用另一个字符串替换。请给我一个Linux命令给我那个文件

nts*_*tty 7

通过使用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.
Run Code Online (Sandbox Code Playgroud)