Linux | Find string in files
Problem
I am trying to search for a string from the XML files (yup, more than an XML file)
Solution
I use grep with option “-an” which will print out the file name and line number of the found string.
The command below will search for text “my text” from all XML files in my current working directory.
grep -an "my text" *.xml
15 Practical GREP, resource
Leave a Reply