greping for text in source files only

Searching source and header files is my most common grep so I like to set up the following aliases:

alias grepch="grep --include=*.[ch] --include=*.cpp -nr"
alias grepc="grep --include=*.[c] --include=*.cpp -nr"
alias greph="grep --include=*.[h] -nr"

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s