I want grep all lines containing words that start with "H" and end with "d". How would i do that? I found that grep ^H will give me the H for everyline.
migrated from stackoverflow.com Nov 4 '11 at 11:14
This question came from our site for professional and enthusiast programmers.
How do you define "words"?
If they're delimited by spaces:
should do it.
More, generally, if your grep supports it (GNU grep does):
finds words delimited by "space" characters: tab, newline, vertical tab, form feed, carriage return, and space.
I'm assuming that "lines containing word" means that you want "foo H123d bar" to match. If each line contains an entire word, replace
EDIT: This might not be 100% correct.
I would try: