In my file_*.txt there are two type of words one containing LC1 only and another containing LC1_R.I would like to grep lines that contain only LC1 not LC1_R. How can I do it?I tried:grep LC1 file_*.txtthen I am getting both lines that contains LC1 as well as those lines which contains LC1_R also.
Search string using grep
grep
You can use \b to match the word boundary:grep '\bLC1\b' file.txt 