Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
(如何)我能否找到在同一个文件中出现 2 个单词的文件,比如Peter和James?有可能ack-grep吗?
Peter
James
ack-grep
你可以 grep 两次:
grep -l Peter * | xargs grep -l James
同样适用于ack:
ack
ack -l Peter * | xargs ack -l James
您可以将 替换为*您可能关心的任何其他文件列表,或用于find为您生成列表。
*
find