我有一台运行CentOS 7的服务器。我需要找到一个包含0774386850的文件,以便我可以将其替换为另一个字符串。请给我一个Linux命令来查找该文件。
请提供一个Linux命令,以便我可以查找包含0774386850的文件。
通过使用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.
使用grep命令在指定路径下递归查找包含"0774386850 "的文件。
您可以使用 grep/fgrep 或者 find 来实现您的目标。