dictionary Spell-checking on the command line

Access a plethora of dictionaries and synonyms from the Linux command line

As a writer, I frequently need to determine the correct spelling or definition of words. I also need to use a thesaurus to find alternate words that may have a somewhat different connotation than the one I might otherwise use. Because I frequently use the Linux command line and text-mode tools to do much of my work, it makes sense to use a command line dictionary.

I really like using the command line for a number of reasons, the primary one being that it is more efficient for me. It is also far more comprehensive than any one or multiple physical paper dictionaries, could ever be. I have been using the Linux dict command for many years and I have come to depend on it.

Installing dict on Linux

The dict program is not installed by default on Fedora, but it's easy to install. Here is how to install it on Fedora and similar systems:

$ sudo dnf install dictd

On Debian, you must also install the dictionary definitions in the dict-gcide package:

$ sudo apt install dictd dict-gcide

No additional configuration is required. The minimalistic /usr/share/doc/dictd/dict1.conf file specifies the remote server for the dictionary databases. This tool uses the Dictionary Server Protocol (DICT) on port 2628.

Looking up words

In a terminal session as a regular user, type dict word to get a list of definitions of that word from one or more dictionaries and thesaurus. For example, look up the word accommodate using this command line:

$ dict accommodate
5 definitions found
From The Collaborative International Dictionary of English v.0.48 [gcide]:
  Accommodate \Ac*com"mo*date\, v. i.
     To adapt one's self; to be conformable or adapted. [R.]
     --Boyle.
     [1913 Webster]
From The Collaborative International Dictionary of English v.0.48 [gcide]:
  Accommodate \Ac*com"mo*date\, a. [L. accommodatus, p. p. of
     accommodare.]
     Suitable; fit; adapted; as, means accommodate to end.
     [Archaic] --Tillotson.
     [1913 Webster]
From The Collaborative International Dictionary of English v.0.48 [gcide]:
  Accommodate \Ac*com"mo*date\, v. t. [imp. & p. p.
     {Accommodated}; p. pr. & vb. n. {Accommodating}.] [L.
     accommodatus, p. p. of accommodare; ad + commodare to make
     fit, help; con- + modus measure, proportion. See {Mode}.]
     1. To render fit, suitable, or correspondent; to adapt; to
        conform; as, to accommodate ourselves to circumstances.
        "They accommodate their counsels to his inclination."
        --Addison.
        [1913 Webster]

     4. To show the correspondence of; to apply or make suit by
        analogy; to adapt or fit, as teachings to accidental
        circumstances, statements to facts, etc.; as, to
        accommodate prophecy to events.
        [1913 Webster]
  
     Syn: To suit; adapt; conform; adjust; arrange.
          [1913 Webster]
From WordNet (r) 3.0 (2006) [wn]:
  accommodate
      v 1: be agreeable or acceptable to; "This suits my needs" [syn:
           {suit}, {accommodate}, {fit}]

      7: make (one thing) compatible with (another); "The scientists
         had to accommodate the new results with the existing
         theories" [syn: {accommodate}, {reconcile}, {conciliate}]
From Moby Thesaurus II by Grady Ward, 1.0 [moby-thesaurus]:
  257 Moby Thesaurus words for "accommodate":
     acclimate, acclimatize, accommodate, accommodate with, accord,
     accustom, adapt, adapt to, adjust, adjust to, advance, afford,
     agree with, alter, ameliorate, arrange, arrange matters,

     turn the tables, turn the tide, turn upside down, vary,
     weave peace between, wont, work a change, work out, worsen,
     yield

I have removed several large section of the results using ellipses () to save space, while leaving enough information to provide an idea of what the typical results might look like. You can also look up a multi-word phrase by enclosing it in quotes, either single quotes or double quote:

$ dict 'air gap'
1 definition found
From The Collaborative International Dictionary of English v.0.48 [gcide]:
  Air gap \Air gap\ (Physics)
     An air-filled gap in a magnetic or electric circuit; specif.,
     in a dynamo or motor, the space between the field-magnet
     poles and the armature; clearance.
     [Webster 1913 Suppl.]

Specifying dictionaries

The dict command uses several online dictionaries, including legal and technical ones. Dictionaries are also available for many languages. You can query the server and display a list of available databases using the -D option, as shown below. On my system, this generates a list of 275 entries, but I've added the head command to only show the first ten results:

$ dict -D | head
Databases available:
 gcide          The Collaborative International Dictionary of English v.0.48
 wn             WordNet (r) 3.0 (2006)
 moby-thesaurus Moby Thesaurus II by Grady Ward, 1.0
 elements       The Elements (07Nov00)
 vera           V.E.R.A. -- Virtual Entity of Relevant Acronyms (August 2020)
 jargon         The Jargon File (version 4.4.7, 29 Dec 2003)
 foldoc         The Free On-line Dictionary of Computing (11 February 2025)
 easton         Easton's 1897 Bible Dictionary
 hitchcock      Hitchcock's Bible Names Dictionary (late 1800's)

You can specify individual dictionaries with the -d option:

$ dict -d wn penultimate
1 definition found

From WordNet (r) 3.0 (2006) [wn]:

  penultimate
      adj 1: next to the last; "the author inadvertently reveals the
             murderer in the penultimate chapter"; "the figures in the
             next-to-last column" [syn: {penultimate}, {next-to-last}]
      n 1: the next to last syllable in a word [syn: {penult},
	   {penultima}, {penultimate}]

Endmost Dictum

Sometimes using words found in the thesaurus is not the best approach to writing as it can obfuscate your meaning. But I do find that the dict command can be immensely useful in choosing the best word for a specific meaning. It also ensures that the words I use are spelled correctly.

There's a dearth of information about dict. The Dict.org website provides only a web-based interface to the dictionaries. The man page covers syntax. But the command is a useful and fun command to have handy. I admit that after discovering the dict command, I spent many hours of the day just trying different things to see what the result would be. I was the kid who read the encyclopedia and dictionary. Yes, I was that kid. In addition to being a useful tool when writing or reading, dict can also be a fun tool to satisfy a bit of curiosity.


This article is adapted from Wordsmith on the Linux command line with dict by David Both, and is republished with the author's permission.