【发布时间】:2023-04-04 00:02:01
【问题描述】:
我有一个格式为:
的文本文件hello world line 1 1234567_45674345 new line this is hello world
this is line 2 and new hello world 980765789_32345332
this is line 3 8976578_45345678 end of file
现在我输入了下划线 1234567_45674345 之前的数字,例如在本例中为 1234567
我需要搜索这个号码并返回完整的单词,即1234567_45674345
我尝试了什么:
我使用了grep 命令,但它返回完整的行,即hello world line 1 1234567_45674345 new line this is hello world
这样做的合适方法是什么?
文件大小顺序为10MB
【问题讨论】:
标签: file search grep keyword-search