TomPHP TomPHP - 21 days ago 4x
Bash Question

grep file extension present inside file

I am trying to find ".eml" inside files but I am getting all sort of text which ends with the "eml" or present with "eml" in the texts.

How can I search the particular ".eml" text present on the files.

$ grep -rsin "*.eml" --exclude-dir=cache src/

Command I am trying right now. Eaxmple text which i am receiving are "yuimenuitemlabel" but its wrong.

I am looking for some thing like this "text.eml" or "sendemail.eml" similar to the output.


In your pattern .eml will match any caracter . followed by eml. You must escape the dot :

grep -rsin "\.eml" --exclude-dir=cache src/