I'm trying to figure out how to find certain words in a file that start with the letters air
and end with the letters ne
. I'd like to print the words that it matches with into a new file called "excluded". I'm very new to this environment of command lines so i'm a bit lost. I've read the manual and cannot find a solution.
I was thinking something along the lines of
grep "air" | "ne" textfile.txt
but obviously it's not working out.
edit: I think I can use the ^
and $
operators to find letters at the beginning and end of a word, however i'm unsure as to how to make it one command so I can simply paste the output into a new file.