Linux aspell command

Updated: 05/04/2019 by Computer Hope
aspell command

aspell is an interactive spell checker. It will scan your files (or anything from standard input), check for misspellings, and allow you to correct the words interactively.


aspell [options] command


command can be one of the following:

usage, -?

Displays a short summary of common spellcheck commands and options.


Send a detailed aspell utility help message to standard output. This is a complete list showing all commands, options, filters and dictionaries.

version, -v

Print version number of aspell library and utility to standard output.

check file, -c file

Spellcheck a single file.

pipe, -a

Run aspell in "ispell -a" compatibility mode.


Produce a list of misspelled words from standard input.

[dump] config

Dump all current configuration options to standard output.

config key

Send the current value of key to standard output.


Output the soundslike equivalent of each word entered.


Generate possible root words and affixes from an input list of words.

expand [1-4]

Expands the affix flags of each affix compressed word entered.

clean [strict]

Cleans an input word list so that every line is a valid word.

munch-list [simple] [single|multi] [keep]

Reduce the size of a word list via affix compression.

conv from to [norm-form]

Converts from one encoding to another.

norm (norm-map|from norm-map to) [norm-form]

Perform Unicode normalization.

[dump] dicts|filters|modes

Lists available dictionaries, filters, or modes.

dump|create|merge master|personal|repl wordlist

Dump, create, or merge a master, personal, or replacement word list.


The following options may be used to control which dictionaries to use and how they behave:

--master=name, -d name

Base name of the dictionary to use. If this option is specified then aspell will either use this dictionary or die.


Location of the main dictionary word list.

--lang=string, -l string

Language to use. It follows the same format of the LANG environmental variable on most systems. It consists of the two letter ISO 639 language code and an optional two letter ISO 3166 country code after a dash or underscore. The default value is based on the value of the LC_MESSAGES locale.


The preferred size of the dictionary word list. This consists of a two-character digit code describing the size of the list, with typical values of: 10=tiny, 20=really small, 30=small, 40=somewhat small, 50=med, 60=kinda large, 70=large, 80=huge, 90=enormous.


Any extra information to distinguish this variety of dictionary from other dictionaries which may have the same lang and size.


Please use the variety option since it replaces jargon as a better choice. The jargon will be removed in the future.

--word-list-path=list of directories

Search path for word list information files.

--personal=file, -p file

File name for the personal word list to use.


Replacements list file name.


Extra dictionaries to use.


(This option is not yet implemented.)

The following options control the behavior of aspell when checking documents:

--ignore=integer, -W integer

Ignore words greater than or equal to integer characters in length.

--ignore-case, --dont-ignore-case

Ignore case when checking words.

--ignore-repl, --dont-ignore-repl

Ignore commands to store replacement pairs.

--save-repl, --dont-save-repl

Save the replacement word list on save all.


Suggestion mode = ultra|fast|normal|bad-spellers

These options modify the behavior of the various filters:

--add-filter=list, --rem-filter=list

Add or remove a filter.

--add-filter-path=paths, --rem-filter-path=paths

Add or remove paths searched for filters.

--mode=string, -e, -H, -t, -n

Sets the filter mode. Mode is one of none, url, email, html, tex or nroff. The alternative shortcut options are '-e' for email, '-H' for Html/Sgml, '-t' for Tex or '-n' for Nroff.


The expected encoding of the document. The default depends on the current locale.

--add-email-quote=list, --rem-email-quote=list

Add or Remove a list of email quote characters.


Number of chars that can appear before the quote char.

--add-html-check=list, --rem-html-check=list

Add or remove a list of HTML attributes to always check. For example, look inside "alt=" tags.

--add-html-skip=list, --rem-html-skip=list

Add or remove a list of HTML attributes to always skip while spell checking.

--add-sgml-check=list, --rem-sgml-check=list

Add or remove a list of SGML attributes to always check for spelling.

--add-sgml-skip=list, --rem-sgml-skip=list

Add or remove a list of SGML attributes to always skip while spell checking.


SGML file extensions.

--tex-check-comments, --dont-tex-check-comments

Check TeX comments (or don't).

--add-tex-command=list, --rem-tex-command=list

Add or Remove a list of TeX commands.

The following options may be used to control the behavior of run-together words:

-C, -B

Consider run-together words valid.


Maximum number of words that can be strung together.


Minimal length of interior words.

The following are miscellaneous options that don't fall under any other category:


Main configuration file. This file overrides aspell's global defaults.


Location of main configuration file.


Location of language data files.


Use this keyboard layout for suggesting possible words. These spelling errors happen if a user accidently presses a key next to the intended correct key.


Alternative location of language data files. This directory is searched before data-dir.


Directory location for personal wordlist files.


Personal configuration file. This file overrides options found in the global config file.

The following options are part of the aspell utility and work independently of the library:

--backup, --dont-backup, -b, -x

The aspell utility creates a backup file by making a copy and appending .bak to file name. This only applies when the command is check file and the backup file is only created if any spelling modifications take place.

--byte-offsets, --dont-byte-offsets

Use byte offsets instead of character offsets.

--guess, --dont-guess, -m, -P

Create missing root/affix combinations not in the dictionary in pipe mode.

--keymapping=aspell, --keymapping=ispell

The keymapping to use, either aspell for the default mapping or ispell to use the same mapping that the Ispell utility uses.

--reverse, --dont-reverse

Reverse the order of the suggestions list in pipe mode.

--suggest, --dont-suggest

Suggest possible replacements in pipe mode. If false, aspell will report the misspelling and make no attempt at suggestions or possible corrections.

--time, --dont-time

Time the load time and suggest a time in pipe mode.

If aspell is run without any command line options it displays a brief help screen and quits.


aspell can accept options via global or personal configuration files so that you do not need to specify them each time at the command line.

The default global configuration file is /etc/aspell.conf (or another file, specified by option --conf), and is checked first.

The default per-user configuration file ~/.aspell.conf located in the $HOME directory (or another file, specified by option --per-conf) is checked next and overrides options set in the global config file. Options specified at either the command line or via an environmental variable override those specified by either configuration file.

Each line of the configuration file has the format:

option [value]

where option is any one of the standard library options above without the leading dashes. For example, the following line will set the default language to Swiss German:

lang de_CH

There may be any number of spaces between the option and the value, however it can only be spaces, i.e. there is no '=' between the option name and the value. Comments may also be included by preceding them with a '#' as anything from a '#' to a newline is ignored. Blank lines are also allowed. The /etc/aspell.conf file is a good example of how to set these options.


aspell check example.txt

Running this command will check the spelling of every word in the file example.txt.If no spelling errors are found, the command will return nothing. If it detects any spelling errors, it will highlight them in context and display your options.

For example, if example.txt contained the following text:

The quirck brown fox jumped over the extraordinarily lazy dog.

...then the menu that aspell gives you would resemble the following:

The quirck brown fox jumped over the extraordinarily lazy dog.
1) quick            6) quirks
2) quirk            7) quicker
3) quirky           8) quickie
4) quack            9) Kirk
5) quark            0) kick
i) Ignore           I) Ignore all
r) Replace          R) Replace all
a) Add              l) Add Lower
b) Abort            x) Exit

For more information about aspell, visit

spell — A spell checker.