Pocket Spanish English Dictionary for the Command Line

Lately I've been thinking about how I only know one language, and how that limits me in terms of just being a worldly figure. A lot of people in my neighborhood speak Spanish, being better at would be useful. Also there seems to be a lot of tech action happening in Latin America. I would love to eventually be a part of that. So what I've ran into is the need for a Spanish to English dictionary. Now there are a lot of great web options. However, I wanted something offline and free. So that led me to FreeDict. Luckily, all the necessary packages are in Debian. However, I found getting started to be a little tricky. So this blog post is meant to document the basic usage.

First you want to use aptitude to search for relevant dictionaries (these will later be called databases).

aptitude search dict-freedict

This will print out a long list so I found this to be a good time to whip out grep to quickly find the Spanish dictionaries.

aptitude search dict-freedict | grep Spanish

In this case we want Spanish to English, and English to Spanish.

sudo apt install dict-freedict-spa-eng dict-freedict-eng-spa

Now in order to use these packages we have to install a freedict client and server. We do this by installing dict and dictd.

sudo apt install dict dictd

You can list all of the available dictionaries.

dict -D

When we are searching for a definition we can specify which dictionary we want to use. So if we wanted to search for the English definition of a Spanish word we can do it like so:

dict -d fd-spa-eng gato

Which outputs:

1 definition found

From Spanish-English FreeDict Dictionary ver. 0.3 [fd-spa-eng]:

  gato /ɡˈato/
  1. cat
  2. jack

If you are having trouble searching for a definition you can optionally choose to try find a word that matches.

dict -d fd-spa-eng -m gato

Which outputs a list of recommended words:

fd-spa-eng: gato pato gata

Now I've found that sometimes I have hard time find words. However, for very basic vocabulary it should provide some assistance. If you notice places it can be improved, make sure to look into how to contribute to the FreeDict project!

More Posts