Search This Blog

Thursday, February 12, 2009

finding the string in the files in dir

finding the string
find . -iname '*php' | xargs grep 'string' -sl

Another common search for me, is to just look at the recently updated files:
find . -iname '*php' -mtime -1 | xargs grep 'string' -sl

would find only files edited today, whilst the following finds the files older than today:
find . -iname '*php' -mtime +1 | xargs grep 'string' -sl

find / -type f -print0 | xargs -0 grep -i pattern

No comments:

Post a Comment