2011年1月12日 星期三

Linux Command - grep, egrep, fgrep

Use regular expression extension patten of grep to filter the text-string

--> Use "-E" to represent using the extended regular expression in the grep
# svn info ./* | grep -E "Last Changed Rev|Path"
or
--> Use twice "-e" to indicate the search pattern double times, means we search the two patterns in the source text string
# svn info ./* | grep -e "Last Changed Rev" -e "Path"
or
--> Directly use the egrep as the program to instead of the grep program
# svn info ./* | egrep "Last Changed Rev|Path"

various type from simplest to complicated one
fgrep -> grep -> egrep

沒有留言: