xref: /original-bsd/usr.bin/look/look.1 (revision 3104a45a)
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)look.1	6.6 (Berkeley) 07/21/91
7.\"
8.Dd
9.Dt LOOK 1
10.Os
11.Sh NAME
12.Nm look
13.Nd display lines beginning with a given string
14.Sh SYNOPSIS
15.Nm look
16.Op Fl df
17.Ar string
18.Op Ar file
19.Sh DESCRIPTION
20The
21.Nm look
22utility displays any lines in
23.Ar file
24which contain
25.Ar string
26as a prefix.
27As
28.Nm look
29performs a binary search, the lines in
30.Ar file
31must be sorted.
32.Pp
33If
34.Ar file
35is not specified, the file
36.Pa /usr/share/dict/words
37is used, only alphanumeric characters are compared and the case of
38alphabetic characters is ignored.
39.Pp
40Options:
41.Bl -tag -width Ds
42.It Fl d
43Dictionary character set and order, i.e. only alphanumeric characters
44are compared.
45.It Fl f
46Ignore the case of alphabetic characters.
47.El
48.Pp
49The
50.Nm look
51utility exits 0 if one or more lines were found and displayed,
521 if no lines were found, and >1 if an error occurred.
53.Sh FILES
54.Bl -tag -width /usr/share/dict/words -compact
55.It Pa /usr/share/dict/words
56the dictionary
57.El
58.Sh SEE ALSO
59.Xr grep 1 ,
60.Xr sort 1
61.Sh COMPATIBILITY
62The original manual page stated that tabs and blank characters participated
63in comparisons when the
64.Fl d
65option was specified.
66This was incorrect and the current man page matches the historic
67implementation.
68.Sh HISTORY
69.Nm Look
70appeared in Version 7 AT&T Unix.
71