words (Unix)

words is a standard file on all Unix and Unix-like operating systems, and is simply a newline-delimited list of dictionary words. It is used, for instance, by spell-checking programs.[1]

With Unix's text processing capabilities, one can use the words file for many purposes.[2] For example, using the grep tool, one can find all three-letter words without any vowels, using regular expressions:

 egrep -i "^[^aeiouy]{3}$" /usr/share/dict/words

The words file is usually stored in /usr/share/dict/words or /usr/dict/words.

On Debian and Ubuntu, the words file is provided by the wordlist package, or its provider packages wbritish, wamerican, etc. On Fedora and Arch, the words file is provided by the words package.

References

  1. Tushar, Shantanu (2013). Linux Shell Scripting Cookbook. Birmingham, UK.: Packt Publishing. pp. 219–220. ISBN 978-1-78216-275-9.
  2. Stutz, Michael (2004). The Linux Cookbook: Tips and Techniques for Everyday Use (2 ed.). San Francisco, California: No Starch Press. pp. 282–284. ISBN 978-1-59327-031-5.

External links


This article is issued from Wikipedia - version of the Saturday, January 30, 2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.