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吗?还是使用另一种组合的工具?
白衣非少年
浏览 1122回答 3
3回答
萧十郎
试试grep-ogrep -oh "\w*th\w*" *-h, --no-filename
Suppress the prefixing of file names on output. This is the default
when there is only one file (or only standard input) to search.
-o, --only-matching
Print only the matched (non-empty) parts of a matching line,
with each such part on a separate output line.