xref: /openbsd/usr.bin/look/look.1 (revision 09467b48)
1.\"	$OpenBSD: look.1,v 1.12 2010/09/03 11:09:29 jmc Exp $
2.\"	$NetBSD: look.1,v 1.3 1994/12/23 01:10:59 jtc Exp $
3.\"
4.\" Copyright (c) 1990, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)look.1	8.1 (Berkeley) 6/14/93
32.\"
33.Dd $Mdocdate: September 3 2010 $
34.Dt LOOK 1
35.Os
36.Sh NAME
37.Nm look
38.Nd display lines beginning with a given string
39.Sh SYNOPSIS
40.Nm look
41.Op Fl df
42.Op Fl t Ar termchar
43.Ar string
44.Op Ar file
45.Sh DESCRIPTION
46The
47.Nm
48utility displays any lines in
49.Ar file
50which contain
51.Ar string
52as a prefix.
53As
54.Nm
55performs a binary search, the lines in
56.Ar file
57must be sorted.
58.Pp
59If
60.Ar file
61is not specified, the file
62.Pa /usr/share/dict/words
63is used.
64Only alphanumeric characters are compared and the case of
65alphabetic characters is ignored.
66.Pp
67The options are as follows:
68.Bl -tag -width Ds
69.It Fl d
70Dictionary character set and order, i.e., only alphanumeric characters
71are compared.
72.It Fl f
73Ignore the case of alphabetic characters.
74.It Fl t Ar termchar
75Specify a string termination character, i.e., only the characters
76in
77.Ar string
78up to and including the first occurrence of
79.Ar termchar
80are compared.
81.El
82.Sh FILES
83.Bl -tag -width /usr/share/dict/words -compact
84.It Pa /usr/share/dict/words
85the dictionary
86.El
87.Sh EXIT STATUS
88The
89.Nm
90utility exits 0 if one or more lines were found and displayed,
911 if no lines were found, or \*(Gt1 if an error occurred.
92.Sh SEE ALSO
93.Xr grep 1 ,
94.Xr sort 1
95.Sh STANDARDS
96The original manual page stated that tabs and blank characters participated
97in comparisons when the
98.Fl d
99option was specified.
100This was incorrect and the current man page matches the historic
101implementation.
102.Sh HISTORY
103The
104.Nm
105command appeared in
106.At v7 .
107