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 install Safari on Linuxthere are two potential workarounds to install safari on linux: use yourself wine or wine in combination with playonlinux (provide graphical user interface (ui) for wine).
- How to reset the password for sudo in Debianthe user password is changed in debian using the passwd command. in this article, tipsmake.com will explain how root users can change their own passwords on debian servers.
- How to extract ISO file with Linuxyou may have downloaded an image file using the popular iso extension. these files (usually quite large) are basically digital versions of optical media discs. all the files on that disk are in the iso archive.
- Should use the Ext4 or Btrfs file system?linux has many different file system options. the current default option is ext4. users are always motivated to change the default file system to btrfs. but is btrfs better than ext4? find the answer through the following article!
- Debian 10 Buster, New features in Debian 10 Busterdebian 10 buster has been released. let's explore the new features in debian 10 buster through the following article!
- How to use the grep command on Debian 10grep stands for global regular expression print. this is a useful command and is widely used by linux system engineers, while searching for a string or patterns with regular files and in the system.