domingo, 27 de diciembre de 2015

Unix Tip: Search certain text in multiple files and folders


This is a very useful unix / linux command to seach a text in all the files and folders that are under a certain directory.
Obviously you need to be positioned in the directory you want to search into.
There could be different variations of this command, the following works very well:

find . -name "*.xml" |xargs grep -i "text"

where *.xml are all xml files, in case you want to find inside all files no matter what the extension is use "*.*"
in case you need to find a text inside some file called config.??? you can use "config.*"

and "text" is the text you are looking for inside the files and folder.

No hay comentarios:

Publicar un comentario