UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 27.17 Finding a Character in a Column Chapter 27
Searching Through Files
Next: 27.19 Finding Words Inside Binary Files
 

27.18 Fast Searches and Spelling Checks with "look"

Every so often, someone has designed a new, faster grep-type program. Public domain software archives have more than a few of them. One of the fastest search programs has been around for years: look. It uses a binary search method that's very fast. But look won't solve all your problems: it works only on files that have been sorted (36.1). If you have a big file or database that can be sorted, searching it with look will save a lot of time. For example, to search for all lines that start with Alpha:

% look Alpha filename
Alpha particle
Alphanumeric

look
The look program can also be used to check the spelling of a word or find a related word; see article 29.3. If you don't have look installed on your system, you can get it from the CD-ROM.

- JP


Previous: 27.17 Finding a Character in a Column UNIX Power ToolsNext: 27.19 Finding Words Inside Binary Files
27.17 Finding a Character in a Column Book Index27.19 Finding Words Inside Binary Files

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System