add affiliation for Oz
[unix-history] / usr / src / usr.bin / look / look.1
CommitLineData
dd9e2e8d
CL
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
f4cde64a 3.\"
dd9e2e8d
CL
4.\" %sccs.include.redist.man%
5.\"
08fc9b74 6.\" @(#)look.1 6.6 (Berkeley) %G%
ef1f0408
CL
7.\"
8.Dd
9.Dt LOOK 1
ee9b0a0a 10.Os
ef1f0408
CL
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
08fc9b74
KB
21.Nm look
22utility displays any lines in
ef1f0408 23.Ar file
08fc9b74
KB
24which contain
25.Ar string
26as a prefix.
27As
ef1f0408 28.Nm look
08fc9b74
KB
29performs a binary search, the lines in
30.Ar file
31must be sorted.
32.Pp
33If
ef1f0408
CL
34.Ar file
35is not specified, the file
36.Pa /usr/share/dict/words
08fc9b74
KB
37is used, only alphanumeric characters are compared and the case of
38alphabetic characters is ignored.
ef1f0408
CL
39.Pp
40Options:
08fc9b74
KB
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.
ef1f0408 53.Sh FILES
08fc9b74
KB
54.Bl -tag -width /usr/share/dict/words -compact
55.It Pa /usr/share/dict/words
56the dictionary
57.El
ef1f0408 58.Sh SEE ALSO
08fc9b74
KB
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.
ef1f0408
CL
68.Sh HISTORY
69.Nm Look
70appeared in Version 7 AT&T Unix.