Searching for a string in the code base may take time depending on its size.
As it may have ".o, .a, .so, .bin etc.," extenstion files and 'grep/egrep' would search whole code base including list mentioned above.
Below procedure may come handy for quick search
a) Create a static file and include all file extensions you want to skip
b) Pass this file as egrep argument.
c) You can alias it to a command
d) tats it :)
The procedure is described here:
a) [/home/sharad/bin]~> cat exclude-mygrep
.*.swp
*.svn-base
*.tar.gz
*.tar.bz2
*.tgz
*.tbz2
*.bz2
*.gz
*.jar
*.gif
*.png
*.jpg
*.pdf
*.zip
*.o
*.a
*.so
*.ko
*.img
*.bin
.*.*.cmd
*.mod.c
*.tmp
*.bak
\#\*\#
\.#\*
tags
cscope.out
As it may have ".o, .a, .so, .bin etc.," extenstion files and 'grep/egrep' would search whole code base including list mentioned above.
Below procedure may come handy for quick search
a) Create a static file and include all file extensions you want to skip
b) Pass this file as egrep argument.
c) You can alias it to a command
d) tats it :)
The procedure is described here:
a) [/home/sharad/bin]~> cat exclude-mygrep
.*.swp
*.svn-base
*.tar.gz
*.tar.bz2
*.tgz
*.tbz2
*.bz2
*.gz
*.jar
*.gif
*.png
*.jpg
*.zip
*.o
*.a
*.so
*.ko
*.img
*.bin
.*.*.cmd
*.mod.c
*.tmp
*.bak
\#\*\#
\.#\*
tags
cscope.out
b) Now in .bashrc file, you can alias this like
alias mygrep="egrep --exclude-from $HOME/bin/.exclude-mygrep -rn "
You can search for a string like:
#mygrep Sharad *