Next: 
Using-Aspell-as-a-Replacement-for-Ispell.html#Using-Aspell-as-a-Replacement-for-IspellUsing Aspell as a Replacement for Ispell ,
Up: 
Basic-Usage.html#Basic-UsageBasic Usage 3.1 Spellchecking Individual Files
To use Aspell to spellcheck a file use:
     aspell check [options] filename   
at the command line where filename is the file you want to
check and 
options is any number of optional options.  Some of
the more useful ones include:
     
–mode=modethe mode to use when checking files.  The available modes are
none, url, email, sgml, tex,
texinfo, nroff, among others.  For more information on the
various modes see 
Notes-on-Various-Filters-and-Filter-Modes.html#Notes-on-Various-Filters-and-Filter-ModesNotes on Various Filters and Filter Modes .
     
–dont-backupdon't create a backup file.
     
–sug-mode=modethe suggestion mode to use where mode is one of ultra,
fast, normal, or bad-spellers.  For more
information on these modes see 
Notes-on-the-Different-Suggestion-Modes.html#Notes-on-the-Different-Suggestion-ModesNotes on the Different Suggestion Modes .
     
–lang=name/-l namethe language the document is written in.  The default depends on the
current locale.
     
–encoding=nameencoding the document is expected to be in.  The default depends on the
current locale.
     
–master=name/-d namethe main dictionary to use.
     
–keymapping=namethe keymapping to use.  Either aspell for the default mapping
or 
ispell to use the same mapping that the Ispell utility
uses. 
   
For more information on the available options, please see
Customizing-Aspell.html#Customizing-AspellCustomizing Aspell .
   
For example to check the file foo.txt:
     aspell check foo.txt
   
and to check the file foo.txt using the bad-spellerssuggestion mode and the American English dictionary:
     aspell check --sug-mode=bad-spellers -d en_US foo.txt
   
If the mode option is not given then Aspell will use the
extension of the file to determine the current mode.  If the extension
is 
.tex, then tex mode will be used, if the extension
is 
.html, .htm, .php, or .sgml it will
check the file in 
sgml mode, otherwise it will use
url mode.
   
For more information on the various modes that can be used, see
Notes-on-Various-Filters-and-Filter-Modes.html#Notes-on-Various-Filters-and-Filter-ModesNotes on Various Filters and Filter Modes .
   
If Aspell was compiled with curses support and the TERMenvironment variable is set to a capable terminal type than Aspell
will use a nice full screen interface.  Otherwise it will use a
simpler “dumb” terminal interface where the misspelled word is
surrounded by two '*'.  In either case the interface should be self
explanatory.
   
If Aspell is compiled with a version of the curses library that support
wide characters than Aspell can also check UTF-8 text.  Furthermore, the
document will be displayed in the encoding defined by the current
locale.  This encoding does not necessary have to be the same encoding
that the document is in.  This means that is is possible to check an
8-bit encoding such as ISO-8859-1 on an UTF-8 terminal.  To do so
simply set the 
encoding option to `iso-8859-1'. 
Furthermore it is also possible to check an UTF-8 document on an 8-bit
terminal provided that the document can be successfully converted into
that encoding.
   
