Linux offline query dictionary method

  
                

In Linux system operation, if you encounter unfamiliar words, you will look up the dictionary, but sometimes you will encounter a situation where the computer just has no network and cannot query the dictionary online. In this case, you can use the dictionary that comes with the system to perform related queries. The following small series will introduce you to the Linux offline query dictionary.

First you need to set up local dictd. Dictd is a dictionary database server. It allows you to access online dictionaries. But wait a minute, are we not going to use it offline? This is why we have to install it locally. It comes with a command line client.

To install on Ubuntu or Debian you have to type:

$ sudo apt-get install dictd

This is very simple. Now you need to install the dictionary. After installing each dictionary plugin, dictd will automatically reload its database. Let's install the English dictionary and the English synonym dictionary.

Enter:

$ sudo apt-get install dict-gcide

$ sudo apt-get install dict-moby-thesaurus

If you wish to query For other languages ​​that can be queried, you can type:

$ sudo apt-cache search “dict package”

This will list the following:

dict-freedict -eng-ara -DictpackageforEnglish-ArabicFreedict dictionary

dict-freedict-eng-cro -DictpackageforEnglish-CroatianFreedict dictionary

dict-freedict-eng-cze -DictpackageforEnglish-CzechFreedict dictionary

dict-freedict-eng-deu -DictpackageforEnglish-GermanFreedict dictionary

dict-freedict-eng-fra -DictpackageforEnglish-FrenchFreedict dictionary

Now that you have successfully installed dictd, you can find it later. The dictionary is gone.

First, let's check if the dictd service is running and what database is installed:

$ dict -I

Sample output:

dictd 1.12 .0/rf on Linux3.2.0-29-generic-pae

On my_host: up 95.000,2 forks (75.8/hour)

DatabaseHeadwordsIndexDataUncompressed

gcide 2036453859 kB 12 MB 38 MB

moby-thesaurus 30263528 kB 10 MB 28 MB

To query a word, you can specify the dictionary to be queried. Let's look at the English one dictionary (gcid):

$ dict -d gcide [the word you want to check]

If you don't use the -d parameter, dictd will search all the installation dictionaries. And return the matching result.

The above is the Linux offline query dictionary method, you need to set dictd, install it locally, and then enter the command line in the command line to query the dictionary to achieve offline dictionary query.

Copyright © Windows knowledge All Rights Reserved