With the proliferation of the internet, finding a definition of a word has become trivial. I still find it interesting (even exciting) that a command line dictionary still exists. Not only does one still exist, as I did research for this article I found a lot more options than I expected.
You're probably asking yourself "What practical use could there be for a command line dictionary in 2019?". Well, none that I can think of. But, just because I cannot think of one, that doesn't mean one doesn't exist.
Researching this topic made me think back to a simpler time before the internet. A time when everything was just text on the screen (ASCII Art!). The nostalgia of this article gives me a warm fuzzy feeling. It momentarily transported me to a time of Bulletin Board Systems (BBS), BASIC programming and handshake noises from a 1200 baud modem. A time before Linux even existed.
Join me on a nostalgic tour through the dictd command line dictionary.
Table of Contents
Installing dictd and Databases
DICT stands for Dictionary Network Protocol and it is available on just about any Linux and UNIX system. In this how-to we will discuss installation and basic usage of the command line dictionary.
Installation on Red Hat Based Systems
The package that gives the dict command is called dictd.
You can install dictd on Red Hat, CentOS, Fedora, or any rpm based distros using yum or dnf:
$ sudo dnf install dictd -y
or
$ sudo yum install dictd -y
You can also install the local dictionary databases for offline use:
$ sudo dnf install gnome-dictionary -y
or
$ sudo yum install gnome-dictionary -y
Installation on Debian/Ubuntu Based Systems
In apt based systems, it is very similar.
$ sudo apt-get install dictd -y
Install local dictionary database:
$ sudo apt-get install dict-gcide
Basic Usage
If you use the dict command without any options, it will use the internet to find definitions and thesaurus entries.
$ dict modem
Example output:
[savona@putor ~]$ dict modem
5 definitions found
From The Collaborative International Dictionary of English v.0.48 [gcide]:
modulator-demodulator \mod"ulator-de
mod"ula`tor\, n.
An electronic device that converts electronic signals into
sound waves, and sound waves into electronic signals, used to
transmit information between computers by the use of ordinary
telephone lines; usually called a {modem}.
[PJC]
...OUTPUT TRUNCATED...
If you want to use your local dictionary database, you can use -d to specify which.
dict -d gcide basic
Example output:
[savona@putor ~]$ dict -d gcide basic
3 definitions found
...
From The Collaborative International Dictionary of English v.0.48 [gcide]:
higher programming language \higher programming language\ n.
(Computers)
A computer programming language with an instruction set
allowing one instruction to code for several assembly
language instructions.
Note: The aggregation of several assembly-language instructions
into one instruction allows much greater efficiency in writing
computer programs. Most programs are now written in some higher
programming language, such as {BASIC}, {FORTRAN}, {COBOL}, {C},
{C++},{PROLOG}, or {JAVA}.
[PJC]
...OUTPUT TRUNCATED...
List Available Databases
You can list all the available local dictionaries using the -D switch:
$ dict -D
Example output:
[savona@putor ~]$ dict -D
dictd 1.12.1/rf on Linux 4.4.0-1-amd64
On pan.alephnull.com: up 450+02:40:24, 59400974 forks (5498.7/hour)
Database Headwords Index Data Uncompressed
gcide 203645 3859 kB 12 MB 38 MB
wn 147311 3002 kB 9247 kB 29 MB
moby-thesaurus 30263 528 kB 10 MB 28 MB
elements 142 2 kB 17 kB 53 kB
vera 12016 136 kB 213 kB 709 kB
jargon 2314 40 kB 565 kB 1346 kB
foldoc 15126 300 kB 2210 kB 5411 kB
easton 3968 64 kB 1077 kB 2648 kB
hitchcock 2619 34 kB 33 kB 85 kB
bouvier 6797 128 kB 2338 kB 6185 kB
...OUTPUT TRUNCATED...
Get Information about a Database
You can get information like maintainer, edition, publisher, etc. about any database using the -i option followed by the name of the database.
$ dict -i fd-eng-ita
Example output:
[savona@putor ~]$ dict -i fd-eng-ita
============ fd-eng-ita ============
English-Italian FreeDict Dictionary
Maintainer: [up for grabs]
Edition: 0.1.1
Size: about 4500 headwords
Publisher: FreeDict.
...OUTPUT TRUNCATED...
Language Translation
A neat little feature that I noticed is that is has the ability to translate words. For example, let's say you wanted to translate something from English to Italian. All you have to do is specify the English-Italian FreeDict Dictionary like so:
$ dict -d fd-eng-ita love
Example output:
[savona@putor ~]$ dict -d fd-eng-ita love
1 definition found
From English-Italian FreeDict Dictionary ver. 0.1.1 [fd-eng-ita]:
love
amare; volere bene
amore
You can use all of the translation dictionaries at one time to translate a word into many different languages.
[savona@putor ~]$ dict -d trans love
29 definitions found
From Danish-English FreeDict Dictionary ver. 0.2.1 [fd-dan-eng]:
love
promise
From English-Arabic FreeDict Dictionary ver. 0.6.2 [fd-eng-ara]:
Love
الحبّ
From English-Croatian Freedict Dictionary [fd-eng-cro]:
love
ljubav, ljubavi, ljubavna, ljubavni, ljubiti, vole, voljeti
From English-Czech fdicts/FreeDict Dictionary [fd-eng-cze]:
love
milá
...OUTPUT TRUNCATED...
Moby Thesaurus
When writing a thesaurus comes in handy. How handy this one is, I can't say. But it's there and you can query it like so:
$ dict -d moby-thesaurus sleep
1 definition found
From Moby Thesaurus II by Grady Ward, 1.0 [moby-thesaurus]:
178 Moby Thesaurus words for "sleep":
KO, annihilation, ataraxia, ataraxy, bane, be caught napping,
be neglectful, be negligent, beauty sleep, beddy-bye, bedtime,
biological death, blackout, blanket drill, bye-bye, calmness,
catalepsy, catatonia, catatony, catnap, cessation of life,
clinical death, coma, comfort, composure, contemplation
For more information see Moby Thesaurus.
Conclusion
The command line dictionary is alive and well. You should now be able to install and use the basic function of the dict command. Like I said in the intro, I can't image what use case a command line dictionary could have in this day and age. But if you can think of one I would love to hear your story.
I really enjoyed writing this article. Even though it is not an article on the Commodore 64, or the Amiga, it still brought me back to a very special time in my life. I am planning on doing more similar to this.
As always, feel free to speak your mind in the comments.
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
5 Comments
Join Our Newsletter
Categories
- Bash Scripting (17)
- Basic Commands (51)
- Featured (7)
- Just for Fun (5)
- Linux Quick Tips (98)
- Linux Tutorials (65)
- Miscellaneous (15)
- Network Tools (6)
- Reviews (2)
- Security (32)
This was very enjoyable reading. Saved the details (installation, usage) and plan on installing soon. One small typo in the "Get Information about a Database" section. You indicated to use the "-d" switch but the commandline sample (correctly) uses the "-i" switch.
Thanks for the write-up on this. Love the commandline and also love the focus and independence of being offline. It also harkens back to an earlier time for me.
Fixed the typo, thanks for catching it and the kind words!
Used it. Love it. Fantastic for basic definitions / word lookup / thesaurus when internet is questionable.
Two tidbits:
1. You can use this online so that you don't have to use proprietary services: http://www.dict.org/bin/Dict
2. At least the versions that ship with Ubuntu are kinda old. And it isn't quite as complete as I would like, honestly. Also, translation can be difficult unless you really know the language and can finesse the right variation from the base word.
As long as you know what you are getting, it is a fantastic resource for those of us who still live on the command line.
Very informative. Searching for the words was my biigest use of google. Now I have it on the command line. Thanks and totally wnjoyed reading it
I'm writing an OCR pipeline, and this command is perfect for both spell checking, and for getting rid of the garbage between the text due to strikethroughs, etc.
I also use it to practice my Spanish and Hebrew, and troll the clients with crazy MoTD thesaurus entries.