Skip to content
Advertisement

How to grep a word inside xml files in a folder

I know I can use grep to find a word in all the files present in a folder like this

JavaScript

But my current directory has many sub-directories and I just want to search in all xml files present in the current directory and its all sub directories. How can I do that ?

I tried this

JavaScript

But it searches for xml files present in the current directory only. It does not do it recursively.

Advertisement

Answer

Try the –include option

JavaScript

Reference: Grep Include Only *.txt File Pattern When Running Recursive Mode

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement