Skip to content
Command line dictionary and thesaurus via google define
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Google "define" from the command line


I love the simplicity of being able to look up words using google's "define {word}" search feature, but sometimes don't want to cutover to a browser to do this. There was at one point an google define API which would have made implementing this a lot easier but it seems to have been de-commed so here we are. This core logic is a python script which leverages Requests to fetch and BeautifulSoup to parse. Terminal color output is supported as well. It is called via a shell script wrapper called "def" which I realize raises some potential conflicts with reserved words so feel free to rename.


  • Python modules
    • Requests
    • BeautifulSoup


# clone the repo
cd ~/repos
git clone

# optionally add to PATH variable
export PATH=$PATH:$HOME/repos/google_define

# optionally modify the PYBIN variable in the def wrapper script

# run it:

$ def moo
moo . moo . mo͞o/
 - make the characteristic deep vocal sound of a cow.
 - the characteristic deep vocal sound of a cow.

 - verb: moo
 -  3rd person present: moos
 -  past tense: mooed
 -  past participle: mooed
 -  gerund or present participle: mooing



  • Default to google suggestion if search word is mis-spelled
  • Better error handling around timeouts
  • Create an output function to cut down on redundancy
You can’t perform that action at this time.