grep -l -i -n -r 'my_defined_function' /home/ivan/myscripts/
grep -linr 'my_defined_function' /home/ivan/myscripts/
Here is the definition:
grep is function name to search a pattern in files
-i means ignore case
-n means output line number
-r search recursively
-l just show file name
grep -Ir --exclude="*\.svn*" "pattern" *
Exclude some condition which I don't want.
--include=PATTERN Recurse in directories only searching file matching PATTERN.
--exclude=PATTERN Recurse in directories skip file matching PATTERN.
- [HowTo] Find Keyword In Files With Grep In Ubuntu
grep --exclude/--include syntax (do not grep through certain files)
0 意見:
張貼留言