11. Spell checking and Dictionary lookup aspell, lookup

Spell checking

Spell checking on the command line is interactive as it is easy. Use the aspell command, which is an interactive spell checker

$ cat > woodchuck.txt
How mch wood wuld a woodchck chuk if a wodchuck coud chuc wod?

Now try correcting the woodchuck.txt file with the aspell check command

$ aspell check woodchuck.txt

Your terminal should turn into an interactive program such as the one below:

How mch wood wuld a woodchck chuk if a wodchuck coud chuc wod?
1) Mach                                     6) ch
2) Mich                                     7) MC
3) mach                                     8) MCI
4) much                                     9) mph
5) Ch                                       0) och
i) Ignore                                   I) Ignore all
r) Replace                                  R) Replace all
a) Add                                      l) Add Lower
b) Abort                                    x) Exit

To replace with suggested, word, use the number keys 0-9. Otherwise, choose and press the appropriate letter.

HTML files

Oftentimes you may work with HTML pages to run spell check. To ignore HTML tags, use the -H option.

Dictionary Lookup

If you're playing Scrabble with a friend and need to prove that a word exist, you can do so right on the command line! Use the command lookup.

$ lookup quetzal
quetzal

If the word exists, it will echo it back to standard out, along with other words with the same beginning characters.

This command works very much like grep, and looks within the dictionary in /usr/dict/words or /usr/share/dict/words. This file simply contains a list of dictionary words.

Take your Linux skills to the next level!

Linux for Beginners

Take your Linux skills to the next level! Try Linux & UNIX

Linux for Beginners doesn't make any assumptions about your background or knowledge of Linux. You need no prior knowledge to benefit from this book. You will be guided step by step using a logical and systematic approach. As new concepts, commands, or jargon are encountered they are explained in plain language, making it easy for anyone to understand.

$ Check price
24.9924.99Amazon 4.5 logo(101+ reviews)

More Linux & UNIX resources

Aching back from coding all day?

Acupressure Mat & Pillow

Aching back from coding all day? Try Back Problems

Relieve your stress, back, neck and sciatic pain through 1,782 acupuncture points for immediate neck pain relief. Made for lower, upper and mid chronic back pain treatment, and improves circulation, sleep, digestion and quality of life.

$$ Check price
144.87144.87Amazon 4.5 logo(1,890+ reviews)

More Back Problems resources

Ad