We all need to look for word definition. Online dictionaries and wikipedia are great but we are not always connected to the net. sdcv is a console version of StarDict dictionary. Using sdcv you can search for definitions while still offline. So here are the step to install and make use of this great program.
Step 1. Installation
Open Up terminal and type:
$ sudo apt-get install sdcv
$ su -c “yum install sdcv”
On Mac OS X
Mac OS comes with a great GUI based dictionary, but cli enthusiasts will enjoy sdcv.
Please install Macports and then open Finder, Go to Application Folder > Utilities Folder and launch terminal and type
$sudo port install sdcv
Step 2. Download Dictionary Files
Now that we have installed sdcv, we need to download dictionary files from the net.
Go to this site1 , site 2 and download dictionary files according to you requirements. For open source fans, Free On-Line Dictionary of Computing (FOLDOC) and Jargon file are must. They are both available from site1.
FOLDOC: Dictionary for computing subjects.
Step 3. Install downloaded Dictionary Files
Now that you have downloaded the dictionary files we need to put them in the folder where sdcv looks for dictionary files when invoked.
On Linux based systems do the following
$sudo mkdir /usr/share/stardict/dic/
$sudo tar -xvjf downloaded.tar.bz2 -C /usr/share/stardict/dic or
$sudo tar -xvzf downlaoded.tar.gz -C /usr/share/stardict/dic
Note: Make sure the user who will be invoking the sdcv command has read and execute permissions on /usr/share/stardict/dic/ and its subfolders.
On Mac OS X
$mkdir -p $HOME/.stardict/dic
$sudo tar -xvjf downloaded.tar.bz2 -C $HOME/.stardict/dic
Note: Unfortunately you need to repeat this process for every user that needs access to these dictionary files.
Step 4. Enjoy sdcv
Searching for definition
$ sdcv Linux (looks for linux in the dictionary.)
$ sdcv (invoes sdcv in the interactive mode, press Control-D to quit).
In earlier article we covered how to use espeak, now you can combine sdcv and espeak together. Sdcv to look for definition and espeak for pronunciation.
$ sdcv Linux && espeak Linux
Here is a picture.
Note: Sometimes due to the long definition of a particular word text scrolls down too fast for you to read, advanced users can set SDCV_PAGER environment variable to /usr/bin/less. Now, less will be used to display to the dictionary’s article. You may consider adding this to your .bashrc file. Check out manpage for sdcv for more information.