[How to] Linux CommandLine Thesaurus | Linux CommandLine Synonyms
I wanted to use my linux commandline to lookup synonyms (thesaurus) recently but didn’t know how.
After some searching I was able to find 2 alternatives that worked very differently, yet helped me tremendously on each account.
Method 1 - DICT
sudo apt install dict dictd dict-gcide dict-moby-thesaurus sudo systemctl enable dictd sudo systemctl start dictd dict --help # or try 'man dict' #dict -d moby-thesaurus YOURWORDHERE
alias thes='dict -d moby-thesaurus'
Method 2 - WordNet
sudo apt install wordnet man wn | grep -B1 synon #wn YOURWORDHERE -syns#, where # is n, v, a, or r #wn YOURWORDHERE -simsv wn # or try 'man wn' wn engineer -synsn | grep -v ^$ #grep just strips empty lines from output wn engineer -synsv | grep -v ^$
Script for both:
#!/bin/sh if [ "$1" = "" ] ; then echo "usage: $0 WORD" fi wn $1 -synsn | grep -v ^$ wn $1 -synsv | grep -v ^$ wn $1 -synsa | grep -v ^$ wn $1 -synsr | grep -v ^$ dict -d moby-thesaurus $1
As always, good luck!
Coolest nerd tech ever: