Grep aliases

In .bashrc

# recursive search in files

function grp {

    GREP_OPTIONS="-rI --color --exclude-dir=\.bzr --exclude-dir=\.git --exclude-dir=\.hg --exclude-dir=\.svn --exclude=tags $GREP_OPTIONS" grep "$@"

}



# recursive search in Python source

function grpy {

  GREP_OPTIONS="--exclude-dir=build --exclude-dir=dist --include=*.py $GREP_OPTIONS" grp "$@"

}

Use:

$ grp WORD .

Or

$ grpy to just search in python files

Then reload bashrc with:

$ . ~/.bashrc

Thank you JB!! (http://tartley.com/)

Comments

Comments powered by Disqus