Linux has several spellcheckers built in. If you are used to graphical spellchekcer, you might find Linux's text based ones fairly rimitive, but they can be used in pipelines, which is quite powerful. Especially useful to scripting.

Here are them.

Look

The look utility displays any lines in file which contain string as a prefix.  As look performs a binary search, the lines in file must be sorted (where sort(1) got the same options -d and/or -f that look is invoked with).

If file is not specified, the file /usr/share/dict/words is used, only alphanumeric characters are compared and the case of alphabetic characters is ignored.

Example 1, list words in /usr/share/dict/words which contain string as a prefix

# look async
async
asynchronism
asynchronisms
asynchronous
asynchronously
asynchrony

Example 2, list any lines in file which contain string as a prefix.

$ look title /boot/grub/menu.lst 

Nothing get searched out, the reason is that the text file has to be alphabetically sorted lines.

$sort /boot/grub/menu.lst >./aaa
$look title aaa
title Scientific Linux (2.6.32-431.11.2.el6.x86_64)
title Scientific Linux (2.6.32-431.17.1.el6.x86_64)

Of course if you use Grep command to archive the same 

$grep "^title" /boot/grub/menu.lst 
title Scientific Linux (2.6.32-431.17.1.el6.x86_64)
title Scientific Linux (2.6.32-431.11.2.el6.x86_64)

Look has 4 options

     -d  Dictionary character set and order, i.e. 
only alphanumeric characters are compared.
(On by default if no file specified).

     -f Ignore the case of alphabetic characters.
(On by default if no file specified).

     -a  Use the alternate dictionary /usr/share/dict/web2

     -t  Specify a string termination character, i.e.
only the characters in string up to and including the first
occurrence of termcharare compared.

 

 

Comments powered by CComment