Reputation:
How do you output only the number of words in /usr/share/dict/words
that begin with any letter, let's say j
?
I was hoping to use egrep 'J*' /usr/share/dict/words
, but does not work well.
Upvotes: 0
Views: 42
Reputation: 114478
If your words are one on each line, then your solution is very close.
grep -ci '^j' /usr/share/dict/words
The ^
symbol means "start of line". -i
flag means case insensitive search, -c
means only report the count.
Upvotes: 2