90

Is there any command line offline dictionary? I know that there are some like StarDict and Artha but how about one in the command line?

Also, I tried dict but it is an online dictionary.

90

sdcv is the console version of Stardict.

1. Install the dictionary

Run the following command in the terminal:

sudo apt-get install sdcv

2. Download dictionary files

Download the dictionary files according to your requirements from the following sources.

3. Install downloaded dictionaries

Make the directory where sdcv looks for the dictionary:

sudo mkdir -p /usr/share/stardict/dic/

The next command depends on whether the downloaded file is a .gz file or a .bz2 file.

If it is a .bz2 file:

sudo tar -xvjf downloaded.tar.bz2 -C /usr/share/stardict/dic

If it is a .gz file:

sudo tar -xvzf downlaoded.tar.gz -C /usr/share/stardict/dic

4. Done!

To search for a word use:

sdcv word

enter image description here

5
  • 3
    Marked and also +1 for the installation guide – PALEN Sep 21 '12 at 14:51
  • That's amazing. Thanks for the informational answer! – SirCharlo Sep 21 '12 at 15:28
  • glad it helped :) – green Sep 21 '12 at 17:01
  • You probably can install the dictionary from packages, for example something like stardict-dic-en. If you install the GUI version of Stardic (e.g. stardict) you probrably will get the english dictionary automatically. – alfC Oct 7 '18 at 18:52
  • Some other links to download, bigdict, google-stardict – Cloverr Sep 22 '20 at 7:13
31

Easy offline dictd installation

Rationale

The dict command can easily be used with offline dictionaries. It suffices to install the dictd daemon with its dependencies alongside a local, offline dictionary. This turns out to be a much easier procedure than installing sdcv as suggested elsewhere on this page.

Installation

Below is shown how to install dictd along with the dict-gcide comprehensive English dictionary. There are many more dictionairies available from the standard repositories.

$ sudo apt-get install dict dictd dict-gcide

Usage

$ dict word

 3 definitions found

    From The Collaborative International Dictionary of English v.0.48 [gcide]:

      Word \Word\, n. [AS. word; akin to OFries. & OS. word, D. woord,
         G. wort, Icel. or[eth], Sw. & Dan. ord, Goth. wa['u]rd,
         OPruss. wirds, Lith. vardas a name, L. verbum a word; or
         perhaps to Gr. "rh`twr an orator. Cf. {Verb}.]
         [1913 Webster]
         1. The spoken sign of a conception or an idea; an articulate
            or vocal sound, or a combination of articulate and vocal
            sounds, uttered by the human voice, and by custom
            expressing an idea or ideas; a single component part of
            human speech or language; a constituent part of a
            sentence; a term; a vocable. "A glutton of words." --Piers
            Plowman.
            [1913 Webster]

                  You cram these words into mine ears, against
                  The stomach of my sense.              --Shak.
            [1913 Webster]

                  Amongst men who confound their ideas with words,
                  there must be endless disputes.       --Locke.
            [1913 Webster]

         2. Hence, the written or printed character, or combination of
            characters, expressing such a term; as, the words on a
            page.
            [1913 Webster]

         3. pl. Talk; discourse; speech; language.
            [1913 Webster]
1
11

You probably also have aspell installed, which has the advantage of giving suggestions for misspelled words. You can call aspell directly on your text file with:

aspell check text.txt

or use it on a single word:

echo wrd | aspell -a
1
  • if not yet installed: sudo apt-get install aspell aspell-es (for program + spanish dictionary) – hoijui Oct 3 '17 at 9:31
5

If you're just looking to see if a word is spelled correctly or exists, you can use grep to look through the word list files in /usr/share/dict/, which are provided by the appropriate wordlist packages. An example to see if "emu" is a valid word:

grep -i "^emu$" /usr/share/dict/american-english

That doesn't have any definitions, however.

2
  • Actually, I'm looking for definitions... – PALEN Sep 20 '12 at 22:44
  • Don't you need single quotes or \$? – John P Apr 2 '17 at 22:36
5

You can use free dictionary with dict command:

  • First install via sudo apt-get install dictd
  • Find out which language dict you want to use sudo apt-cache search "dict-freedict"
  • After find these names install them (for ex.) sudo apt-get install dict-freedict-eng-tur
  • Check which languages are installed dict -D
  • Use like: dict "word"
  • Specific usage: dict -d fd-eng-tur "word"
3

How about downloading dictionary text file from the sites for example this link (warning: 4.5 MB), and then finding the text with command like grep "word" dictionary.txt

Or also by using VIM editor to search for the word with its command eg. /Word. And by pressing n or N for next or previous occurance of the pattern is more fun with finding meaning of the word.

1

I use the Princeton University WordNet application. I did not want to deal with Tcl/Tk so prepared a make file that allows you to run WN as a command line application. You do have to compile it, but I provide instructions to help somewhat. I personally find it automatic to popup a terminal on my Linux computer and type "wn unknown-word -over" anytime I want the definition for unknown-word. The nice thing about WordNet is that you get synonyms, antonyms and other linguistic nuances if you want it. Here is my github download link:

Dalton Bentley github link for WordNet command version

Incidentally, I edited all of the Princeton linguistic help files into a rational pdf which those interested in the more advanced capabilities will appreciate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.