grep
的手册页上说:
-r, --recursive
Read all files under each directory, recursively
好的,那怎么可能:
# grep -r BUILD_AP24_TRUE apache
# grep BUILD_AP24_TRUE apache/Makefile.in
@BUILD_AP24_TRUE@mod_shib_24_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
(...)
答案 0 :(得分:1)
有两种可能导致这种类型的问题:
grep
的别名是排除您感兴趣的文件的东西。
感兴趣的文件位于符号链接目录中,或者它本身是符号链接。
就您而言,这似乎是第二个原因。一种解决方案是使用grep -R
代替grep -r
。来自man grep
:
-r, --recursive
Read all files under each directory, recursively, following symbolic
links only if they are on the command line. Note that if no file
operand is given, grep searches the working directory.
This is equivalent to the -d recurse option.
-R, --dereference-recursive
Read all files under each directory, recursively.
Follow all symbolic links, unlike -r.