xref: /original-bsd/usr.bin/look/look.1 (revision 6b4229fb)
1.\" Copyright (c) 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)look.1	8.1 (Berkeley) 06/14/93
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.Op Fl t Ar termchar
18.Ar string
19.Op Ar file
20.Sh DESCRIPTION
21The
22.Nm look
23utility displays any lines in
24.Ar file
25which contain
26.Ar string
27as a prefix.
28As
29.Nm look
30performs a binary search, the lines in
31.Ar file
32must be sorted.
33.Pp
34If
35.Ar file
36is not specified, the file
37.Pa /usr/share/dict/words
38is used, only alphanumeric characters are compared and the case of
39alphabetic characters is ignored.
40.Pp
41Options:
42.Bl -tag -width Ds
43.It Fl d
44Dictionary character set and order, i.e. only alphanumeric characters
45are compared.
46.It Fl f
47Ignore the case of alphabetic characters.
48.It Fl t
49Specify a string termination character, i.e. only the characters
50in
51.Ar string
52up to and including the first occurrence of
53.Ar termchar
54are compared.
55.El
56.Pp
57The
58.Nm look
59utility exits 0 if one or more lines were found and displayed,
601 if no lines were found, and >1 if an error occurred.
61.Sh FILES
62.Bl -tag -width /usr/share/dict/words -compact
63.It Pa /usr/share/dict/words
64the dictionary
65.El
66.Sh SEE ALSO
67.Xr grep 1 ,
68.Xr sort 1
69.Sh COMPATIBILITY
70The original manual page stated that tabs and blank characters participated
71in comparisons when the
72.Fl d
73option was specified.
74This was incorrect and the current man page matches the historic
75implementation.
76.Sh HISTORY
77.Nm Look
78appeared in Version 7 AT&T Unix.
79