A Code Monkey's Blog

Quickly look up a word or phrase from commandline

I wrote two very short Bash functions to help me quickly look up a word or phrase using elinks. You can use w3m as you wish but elinks shows a better layout in my eyes.

# look up on urbandictionary.com

ub () {
 a=$@
 elinks www.urbandictionary.com/${a// /%20}
}

# look up on thefreedictionary.com
fd () {
 a=$@
 elinks www.thefreedictionary.com/${a// /+}
}

Usage: ub your_word fd your_word