Alfred’s Computing Weblog

Alfred Java-cored Computing Weblog

Posts Tagged ‘grep

Linux | Find string in files

leave a comment »

I am trying to search for a string from the XML files (yup, more than an XML file)

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

Written by Alfred

August 17, 2011 at 14:58

Posted in linux

Tagged with , , ,