How to Install a Dictionary for Use in Linux Terminal

Terminal Dictionary Featured Image

Learning new words can be a pain when you’re pressed for time and the pages of a dictionary can only be flipped so fast. Thankfully, the Internet has placed a lot of powerful tools at your fingertips to help streamline such processes. After all, Google gives you word definitions right in its search results these days. However, even Google can’t help you when you’re stuck writing offline.

A locally stored dictionary utility can really come in handy when no other dictionary is available (or even when there is!), and options abound in the world of Linux software. Among these, there is one that runs quite nicely from your system’s terminal, and it’s called SDCV.

What Is SDCV?

SDCV is the command-line version of the popular StarDict extensible GUI dictionary application. The name stands for “StarDict Console Version.” StarDict itself runs on all major operating systems, including Windows, BSD and Linux variants.

What makes StarDict special also makes SDCV special – the availability of a vast assortment of dictionary files to incorporate into its lookup function. For the savvy, the option of handcrafting a dictionary is available as well.

In addition to the potential for simultaneous searching of multiple dictionaries at once, SDCV also benefits from configurable search patterns. We’ll take a look at the process for installing it and your first dictionary file below.

Install SDCV

Installing SDCV is straightforward in Ubuntu with the apt utility, and it is available in Debian’s repositories as well. Here’s the command for installation in Ubuntu:

Terminal Dictionary Sdcv Install

Once installed, SDCV can be called, but it won’t have anything to offer as we haven’t installed any dictionaries yet.

Install a Dictionary File

First, we’ll need to find a dictionary file that SDCV can handle (DICT format). Luckily, there are some great ones linked in StarDict’s homepage.

We’ll use the Collaborative International Dictionary of English for this example.

This file comes compressed as a tarball. We’ll need to uncompress it and place it in the right directory for SDCV to recognize it. The following code accomplishes both at once:

Terminal Dictionary Dict File

To use the code above, replace “YOURFILEGOESHERE” with the full name and extension of your downloaded tar file. The command will extract the files contained inside to SDCV and StarDict’s shared dictionary folder at “/usr/share/stardict/dic.”

Run a Search

Now you can run SDCV from your terminal with the following command (changing “WORD” to the word you want to look up):

Terminal Dictionary Lookup

If SDCV comes up with multiple options for you to choose from, you can specify which you are interested in by selecting its number.

Terminal Dictionary Sdcv Multiple Choices

Wikit

As a helpful addition to SDCV, you can also make use of another command-line tool for informational queries called “Wikit.”

Wikit allows you to quickly search Wikipedia from your terminal and see a synopsis for any term covered by the world’s community-maintained encyclopedia.

Note: Wikit requires Node.js (and npm) to be installed on your system as well and does not work offline. To install Node.js and npm for Ubuntu, use the following code:

Terminal Dictionary Node Install

To install Wikit, just use the following command:

Terminal Dictionary Wikit Install

Once you have installed Wikit, you can call it with the following command (change “SEARCH_PHRASE” to your own search phrase):

Terminal Dictionary Wikit Lookup

With SDCV and Wikit, you can quickly find information and definitions for pretty much anything. Try adding additional dictionary files to your SDCV library for more extensive offline searches.

5 comments

  1. In this day and age, when other major O/Ss are using GUI almost exclusively, you are advocating the Command Line? No wonder prospective Linux users look at it and say “Not for me!” Besides giving one that l33T feeling, what is the advantage, if any, of using a command line dictionary? That is soooo last millennium!

    1. @dragonmouth I see what you’re saying, however I fully disagree. I work on the CLI almost exclusively. It is simply faster and has way more power than any GUI. I would highly recommend trying to use the CLI with a fun home project and see the power it yields. I would agree for most “standard” users they fall in the group of “we only use the GUI”, but since all *.nix systems are files; you can work so much faster via the CLI.

      1. “you can work so much faster via the CLI”
        You can work “so much faster via the CLI” ONLY if you are fluent in it. If I have to look up every command and every option, it definitely will not be faster, in the short AND the long run. The second thing is how much faster? How much time can you save per day? Seconds? Minutes? People boast that their systems go from PowerOn to a working desktop in 20 seconds. Sounds great but how often do you do a cold re-boot, especially when using *nix? How many times a day do you use a dictionary?

        Don’t get me wrong, I’m not putting CLI down. It has its uses. It is powerful and flexible but the value of “speed” can be argued. Especially when it comes to new Linux users.

    2. Hi @dragonmouth
      Anyone who has worked with UNIX for any time knows there is more then one why to do everything in Linux/Unix. If you fell more comfortable working with a GUI you can, there is a Linux GUI based program that will do everything you need, you never have to open a command line.
      However even if you just work with MS Windows, if you work in a multi-system environment, you will notice the trend to command administration. Microsoft has greatly increase the ability of Powershell over the last few years. Windows has always been able to run a command and people have found that it is faster to type on the command line and add options to the commands, then to right click open Notepad, modify the command, save it and run it. You can even start GUI Windows programs from Powershell or CMD local or remote systems.

      1. “Microsoft has greatly increase the ability of Powershell over the last few years.”
        Kind of ironic since the biggest whine from Microsoft users has been that to use Linux, one MUST know command language.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.