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 "[email protected]"

}



# recursive search in Python source

function grpy {

  GREP_OPTIONS="--exclude-dir=build --exclude-dir=dist --include=*.py $GREP_OPTIONS" grp "[email protected]"

}

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