How to spell check in Linux Terminal
Most text editors often come with a spell checker to check the spelling of your text. But did you know that Linux also has a command line spell checker in Terminal?
The utility is called aspell and is installed by default on Ubuntu. This tool has many switches available, making users really appreciate its capabilities. This is how you can use aspell to check spelling in Terminal.
Introduction to aspell
The article works with a file called README.md , in which some words were misspelled.

The example will run it through the spell checker with the following command.-C switch is used to specify the file to check.
aspell -c README.md
This command will open an interactive window as below. In the top section, the file content is displayed.aspell found spelling mistakes. Now, it will prompt each error, along with the proposed error correction plan that the user can choose. Here, 'Attempyting' is the first spelling mistake.
The bottom section contains suggested words to replace the wrong word. A numeric value should be entered near the suggested words for the spell checker to do its job.

After typing 1
, aspell will move to the next wrong word and display suggestions for fixing it.

In this way, all necessary edits can be made. When all changes have been made to a file, the interactive spell checker will automatically exit. A backup for this file is created with the .bak extension.README.md is the modified file and README.md.bak is a file with typos.
The configuration file is located in /etc/aspell.conf. The same content can be viewed with the following command:
aspell dump config

The result has information on the dictionary being used, the position of the word list to check, etc.

Use another dictionary
Consider the country.txt file that has two spelling versions for the word 'recognize'. The version with 's' corresponds to British English and the version with 'z' corresponds to American English.
The Indian English dictionary is similar to the English English dictionary. Suppose you want to perform a spell check on this file based on the American English dictionary.

The following command shows a long list of available dictionaries.
apsell dump dicts

You can specify dictionaries to use in spell checking, using the -d switch . Use the American English dictionary as below.
aspell -d en_US -c "country.txt"
The first error is the word 'recognize' with the letter s and the proposed suggestion is to replace s with z .

When the correction is made, the third line in the file is identified as an error and may be corrected.

Use accented letters
Some languages that combine accented letters as shown in the accent-example.txt file are shown below.

Performing a spell check on this file with the default dictionary will treat the accented letter as an error.
aspell -c accents-example.txt

Proposals are provided to replace accented letters with regular letters. In this case, you can use a dictionary that supports accented letters to handle those files.
aspell -d en-w_accents -c accents-example.txt
The specified dictionary accepts accented letters and the accents-example.txt file successfully passes the spelling test.
Other options
aspell can also be used with HTML / XML files and Tex / LaTex files by providing predefined switches. It can also be configured to handle hyphenated words and skip upper or lowercase letters.
The full list of options and switches available for aspell can be found on the man page and in the Texinfo guide .
You should read it
- 6 interesting terminal commands on Mac
- How to fix the problem of being unable to enter Terminal in Linux
- 8 methods to quickly check website status from Linux Terminal
- How to install dictionaries in Linux Terminal
- How to back up and restore Linux Terminal history
- 8 best free Terminal Emulator apps for Android
- How to play Game Boy games on Linux Terminal
- How to use Linux Terminal as a computer
May be interested
- How to turn off spell check mode in Windows 10?windows 10 as well as the microsoft office suite, now has the function to automatically correct spelling, grammar ... when users type in the system. but for many people, this is a feature that causes trouble, unnecessary. so what to do to remove this automatic spell check feature?
- How to fix the problem of being unable to enter Terminal in Linuxnothing is perfect and sometimes, even terminal can stop responding or ignore what you type. if your terminal crashes and you can't enter it, here are some of the most common causes and solutions for them.
- Make Terminal More Fun with These 8 Linux Tools!these tools will help you be more efficient, productive, and even have more fun working in terminal. let's take a look at some of our favorite command line tools!
- 7 Ways to Restart Linux from Terminalrestarting linux from the terminal may seem difficult, but don't worry, it's quite simple once you know the right commands. restarting linux is necessary after updating, troubleshooting, or performing system maintenance.
- 5 interesting entertainment games in Linux Terminalif you are looking to learn how to use the linux terminal, a great approach for beginners is to install and play some simple games.
- How to turn off spell checking on Microsoft OneNotewhen you turn off spell checking on onenote, it is easier to enter draft content without a grammatical error message.
- How to run 2 or more Terminal commands at the same time on Linuxif you use linux, you probably know how to use useful commands to work with files, install software and launch programs. however, one thing you don't know is that you can still run multiple commands at the same time.
- 14 interesting Linux commands in Terminalterminal is a very powerful tool, but it can become 'interesting' through a few bash commands that quantrimang will introduce to you later. let's follow up and find out because some commands are quite useful.
- How to check the desktop environment you are using on Linuxas you probably know, linux-based operating systems are heavily focused on the command line to perform operations. a minimal distro like arch linux will give you a dark terminal installation.
- 6 interesting terminal commands on Macterminal is a handy utility, often found on unix-based computers, such as linux and macos. there are many interesting things to do in the terminal. regardless of your experience, you can use these great terminal commands on mac.