【发布时间】:2015-08-08 00:56:06
【问题描述】:
假设我有一个文件 foo.txt,我想搜索“bar”,但我也想搜索 foo.txt 包含的任何文件。例如:
foo.txt:
blah
blahblah.txt
bar
bar.txt
/user/john/baboon.txt
blahblah.txt:
monkey
bar
giraffe
bar.txt:
elephant
bar zebra
hippo
/user/john/baboon.txt:
lion
leopard
它返回类似的东西
foo.txt line 3: bar
foo.txt line 4: bar.txt
blahblah.txt line 2: bar
bar.txt line 2: bar zebra
我玩过 grep,我想我以前见过类似的东西
【问题讨论】:
-
如何知道
foo.txt中的内容是文件还是单词? -
类似于如何尝试在 vim 中转到文件 (gf)?我也不确定它是如何工作的