Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个关于 linux 中正则表达式的简短问题。有一本书的.txt格式(Dracula.txt)。我不知道如何确定这本书中最常用的3个以开头v和结尾的单词e并显示它们。我知道我应该使用grep
.txt
v
e
grep
提前谢谢了。
你需要使用更多,然后只是grep为了那个>>
grep -io '\bv[a-z]*e\b' Dracula.txt | sort -f | uniq -ic | sort -nr | head -3