Git Bash - find words in a file (or string) that match a specified substring
cmd: cat test.txt | grep pin
results: prints all lines containing output
I only want grep now for words containing pin. What is the command for this?
Thank!
Everyone, thanks for your comments. I am using Git Bash (version 1.9.4). Grep does not have the -o option in this shell. There is a -w option. I tried: grep -w 'pin' test.txt but it returns nothing.
Does anyone use Git Bash to solve this problem?
Thanks everyone.
+3
source to share