打印以" X"

时间:2015-04-28 17:55:49

标签: bash terminal

我可以使用什么命令打印以字符串开头的每一行?例如:

的test.txt

Hello world!
How are you?
I am doing fine.
blah blah blah.


echo test.txt startsWith H

打印

Hello world!
How are you?

1 个答案:

答案 0 :(得分:1)

您可以使用grep -E '^H' file

{{1}}