aspell Command Examples in Linux

aspell is a command-line utility for spell checking and correcting text. It is commonly used in Unix-like operating systems such as Linux and macOS. aspell checks the spelling of a text file and suggests corrections for misspelled words. It can also be used to create a personal dictionary of words to be ignored during spell checking.

To use aspell, you need to have it installed on your system. On most systems, you can install aspell using the package manager. For example, on a Debian-based system, you can use the following command to install Aspell:

# apt-get install aspell

Once Aspell is installed, you can use it to check the spelling of a text file by running the following command:

# aspell check file.txt

Aspell will scan the file and flag any misspelled words. It will also suggest corrections for each misspelled word. You can use the –mode option to specify the language of the text. For example, to check the spelling of a French text file, you can use the following command:

# aspell --mode=fr check file.txt

Aspell also provides a number of options for customizing the spell checking process, such as ignoring words with certain capitalization or ignoring words that are in all uppercase. You can view the full list of options by running aspell –help.

aspell Command Examples

1. Spell check a single file:

# aspell check path/to/file

2. List misspelled words from standard input:

# cat file | aspell list

3. Show available dictionary languages:

# aspell dicts

4. Run `aspell` with a different language (takes two-letter ISO 639 language code):

# aspell --lang=cs

5. List misspelled words from standard input and ignore words from personal word list:

# cat file | aspell --personal=personal-word-list.pws list
Related Post