aspell (along with others such as
hunspell), can be used to spellcheck a file from the terminal. You can also specify a file “mode” for which to scan. Modes include plain text, HTML, sgml, LaTeX, and others.
To list all of the spelling mistakes of the file “testfile.txt”, use:
aspell list < textfile.txt
To list all of the spelling mistakes of the HTML document “testpage.html”, use:
aspell --mode=html list < testpage.html
As always, be sure to take a look at the man pages for more information. Keep in mind that certain distributions may not come with
aspell pre-installed, so you may need to use the package manager to install it (ie.
apt-get install aspell or
yum install aspell).