grep只能顯示匹配搜索模式的單詞嗎?是否有辦法使grep輸出與搜索表達(dá)式匹配的文件中的“單詞”?如果我想在多個(gè)文件中找到“th”的所有實(shí)例,我可以這樣做:grep "th" *但是輸出將是類(lèi)似的(粗體是由我);some-text-file : the cat sat on the mat
some-other-text-file : the quick brown fox
yet-another-text-file : i hope this explains it thoroughly使用相同的搜索,我希望它輸出的是:the
the
the
this
thoroughly這有可能使用grep嗎?還是使用另一種組合的工具?
grep只能顯示匹配搜索模式的單詞嗎?
白衣非少年
2019-07-19 14:29:01