Some useful tips using the find linux command to search for text

Some useful tips using the find linux command to search for text


Searching for texts into projects source code is a common task when you are developing.

I think the best aproach is to go to shell and run the commands bellow:

    Search for xml files containing the text "org.alfresco.util.CronTriggerBean"
      find . -type f -name "*.xml" -print | xargs grep "org.alfresco.util.CronTriggerBean"


        Look for javascript files containing the text "renderPickerHTML"
          find . -type f -name "*" -print | xargs grep "renderPickerHTML"

          But there are some projects that have lots of "minimized" files, and those files are not that useful when you are searching for sample code. In these cases, its better to filter the results, ignoring the minized ones.

          To do this, you just need to include one parameter to your command, like this

          find . -type f -not -iwholename *-min.js -name "*" -print | xargs grep "renderPickerHTML"

          The only difference here is the "-not -iwholename *-min.js.


          I hope you enjoy this quick tip.

          download file now

          Comments

          Popular posts from this blog

          Spider Man Friend Or Foe ISO Free Download PPSSPP Setting

          Sorry Mutter closed unexpectedly on Ubuntu 10 10

          Sony Xperia T2 Ultra dual