2012-02-09 79 views
2

我有这个文件调用helloworld.txt:如何使用grep打印文件中的确切单词?

starthelloworld_some_text.jpgend
starthelloworld_different_text.jpgend
starthelloworld_another_different_one.jpgend

,我想grep命令只显示是这样的:

helloworld_some_text.jpg
helloworld_different_text.jpg
helloworld_another_different_text.jpg

我一个新手,确实需要从你们的帮助。请给我看一些方法,我真的很感激你的时间。非常感谢。

回答

4

grep -o "hello.*\.jpg" helloworld.txt

+0

那甜美。谢谢 – Vicheanak 2012-02-09 22:31:01

相关问题