标签: 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?
答案 0 :(得分:1)
您可以使用grep -E '^H' file :
grep -E '^H' file
{{1}}