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.
假设我想查找当前目录中至少出现一次 namePeter和至少出现一次name 的所有文件James。
Peter
James
我可以按照此线程ack-grep -l Peter * | xargs ack-grep -l James中的建议找到这些文件的列表。
ack-grep -l Peter * | xargs ack-grep -l James
但是我怎样才能显示这些单词出现的行呢?简单地做ack-grep Peter * | xargs ack-grep James不会返回预期的输出。
ack-grep Peter * | xargs ack-grep James
ack-grep -l Peter | xargs ack-grep -l James | xargs ack-grep 'Peter|James'