Search distinct files

Hello ,

Can anyone help me with my below query

I am trying to find a text in directory of files via below command

 
grep -i cmps_cgs_crs_rfnc_id *

But it returns multiple times same file name i.e if the text found in a file 4 times the file name shown 4 times in the o/p

Is there anyway to get the filename once doesn't matter how many times it appears in the file

Thanks a lot!!!!!!!!!!!!!!!

grep -il cmps_cgs_crs_rfnc_id *

if you have gnu grep then you can try the below

grep -m 1 -i cmps_cgs_crs_rfnc_id *
1 Like