How to Spell Check your Documents from the Linux Command Line

This detailed guide will show you how to use the tool “aspell” to spell check documents from the Linux command line.

Many of us are used to using fancy word processors for typing out letters and other documents. Most word processors come bundled with an automatic spellcheck feature built in. Even email clients have these. However, if you part of a small, dying breed of people who still use command line text editors you might find the spell checking feature a bit limited. Well, we his a wonderful Linux command line utility, aspell, coming to our rescue.

aspell is an interactive, command-line spell checking tool. Other than being free and really easy to install on your Linux desktop (if not bundled in the default installation) it has some very cool interactive features and can plug into several applications, making it quite useful. The utility is quite useful even on its own, and has been designed keeping ease of use in mind. Let’s take a closer look at it.

First, let’s see how to install it, in case it’s not already install on your Linux desktop or laptop. If you are using Ubuntu you just execute the command # sudo apt-get install aspell. If you are using Fedora Core or a Linux flavor derived from Red Hat Linux you execute # yum install aspell. If you are using a different distribution of Linux please look for a binary package of aspell or head to the project’s website and download the source version and compile it. I will now proceed with the assumption that you have aspell installed.

Get Started With aspell

Now that you have aspell installed you may begin using it. The simplest form of usage for this utility is with the following command structure: # aspell check filename.txt. This would translate to something like the following, if you wanted to check for spelling mistakes in a file called helloworld.html:

# aspell check helloworld.html

aspell will go through the document and check it for spelling mistakes and return with an interactive interface where you can go through the document at hand and aspell will suggest spelling correction options. This interface is very easy to use and all the instructions are visible at all times. aspell‘s suggested spelling options will be available as numbers, as well as options to ignore a particular instance of the spelling or all of its instances.

using aspell to spell check from the linux command line
click to enlarge

When you are done with checking and correcting the spelling errors you can either hit x to save the changes and exit the document, or you can hit b to abort the session without saving the changes you made.

Adding More Dictionaries

You may have some basic dictionary installed along with the installation of aspell, however, there are several dictionaries available to be installed. To see some of the ones available to you execute the command # sudo apt-cache search aspell if on Ubuntu, or # yum search aspell on Fedora. You can download additional dictionaries and improve your database of words.

adding a dictionary to the aspell app
click to enlarge

If this article helped you, I'd be grateful if you could share it on your preferred social network - it helps me a lot. If you're feeling particularly generous, you could buy me a coffee and I'd be super grateful :)

buy a coffee for

Home » Linux » How to Spell Check your Documents from the Linux Command Line

Leave a Comment

Your email address will not be published.