sdcv (Stardict under Console Version) is a cool and useful command line program to define words directly in the terminal, and it’s available in both the main Arch and Debian repositories. The dictionaries themselves, however, must be downloaded separately. Here are the steps I took, along with the alias I setup in my .bashrc file.
- Install sdcv
sudo pacman -Sy sdcvor
sudo apt-get install sdcvif you’re using a Debian-based distro.
- Next download your preferred dictionary from here download.huzheng.org. I used this one.
- The dictionary needs to be extracted into a specific folder that sdcv knows where to look.
I had to create this folder myself: /usr/share/stardict/dic
- Now, extract the dictionary to the folder that was just created
sudo tar -xjvf stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2 -C /usr/share/stardict/dic
Now you can run “sdcv” from within a terminal and it will prompt you to enter a word you’d like to define. Alternatively, you can run
sdcv [word to define]
I also created an alias for sdcv so that I can simply type “define” and the word to get a definition. This can be done by adding the following to your .bashrc file in your home directory: