xref: /netbsd-src/usr.bin/look/look.1 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1*01869ca4Swiz.\"	$NetBSD: look.1,v 1.10 2017/07/03 21:34:20 wiz Exp $
22b8585beSjtc.\"
32b8585beSjtc.\" Copyright (c) 1990, 1993
42b8585beSjtc.\"	The Regents of the University of California.  All rights reserved.
5dab5e017Scgd.\"
6dab5e017Scgd.\" Redistribution and use in source and binary forms, with or without
7dab5e017Scgd.\" modification, are permitted provided that the following conditions
8dab5e017Scgd.\" are met:
9dab5e017Scgd.\" 1. Redistributions of source code must retain the above copyright
10dab5e017Scgd.\"    notice, this list of conditions and the following disclaimer.
11dab5e017Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
12dab5e017Scgd.\"    notice, this list of conditions and the following disclaimer in the
13dab5e017Scgd.\"    documentation and/or other materials provided with the distribution.
1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
15dab5e017Scgd.\"    may be used to endorse or promote products derived from this software
16dab5e017Scgd.\"    without specific prior written permission.
17dab5e017Scgd.\"
18dab5e017Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19dab5e017Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20dab5e017Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21dab5e017Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22dab5e017Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23dab5e017Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24dab5e017Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25dab5e017Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26dab5e017Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27dab5e017Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28dab5e017Scgd.\" SUCH DAMAGE.
29dab5e017Scgd.\"
302b8585beSjtc.\"     @(#)look.1	8.1 (Berkeley) 6/14/93
31dab5e017Scgd.\"
322b8585beSjtc.Dd June 14, 1993
33dab5e017Scgd.Dt LOOK 1
34dab5e017Scgd.Os
35dab5e017Scgd.Sh NAME
36dab5e017Scgd.Nm look
37dab5e017Scgd.Nd display lines beginning with a given string
38dab5e017Scgd.Sh SYNOPSIS
397eabdb0eSlukem.Nm
40dab5e017Scgd.Op Fl df
412b8585beSjtc.Op Fl t Ar termchar
42dab5e017Scgd.Ar string
43dab5e017Scgd.Op Ar file
44dab5e017Scgd.Sh DESCRIPTION
45dab5e017ScgdThe
467eabdb0eSlukem.Nm
47dab5e017Scgdutility displays any lines in
48dab5e017Scgd.Ar file
49dab5e017Scgdwhich contain
50dab5e017Scgd.Ar string
51dab5e017Scgdas a prefix.
52dab5e017ScgdAs
537eabdb0eSlukem.Nm
54dab5e017Scgdperforms a binary search, the lines in
55dab5e017Scgd.Ar file
56dab5e017Scgdmust be sorted.
57dab5e017Scgd.Pp
58dab5e017ScgdIf
59dab5e017Scgd.Ar file
60dab5e017Scgdis not specified, the file
61dab5e017Scgd.Pa /usr/share/dict/words
62dab5e017Scgdis used, only alphanumeric characters are compared and the case of
63dab5e017Scgdalphabetic characters is ignored.
64dab5e017Scgd.Pp
65dab5e017ScgdOptions:
66dab5e017Scgd.Bl -tag -width Ds
67dab5e017Scgd.It Fl d
68dab5e017ScgdDictionary character set and order, i.e. only alphanumeric characters
69dab5e017Scgdare compared.
70dab5e017Scgd.It Fl f
71dab5e017ScgdIgnore the case of alphabetic characters.
722b8585beSjtc.It Fl t
732b8585beSjtcSpecify a string termination character, i.e. only the characters
742b8585beSjtcin
752b8585beSjtc.Ar string
762b8585beSjtcup to and including the first occurrence of
772b8585beSjtc.Ar termchar
782b8585beSjtcare compared.
79dab5e017Scgd.El
80dab5e017Scgd.Pp
81dab5e017ScgdThe
827eabdb0eSlukem.Nm
83dab5e017Scgdutility exits 0 if one or more lines were found and displayed,
84*01869ca4Swiz1 if no lines were found, and >1 if an error occurred.
85dab5e017Scgd.Sh FILES
86dab5e017Scgd.Bl -tag -width /usr/share/dict/words -compact
87dab5e017Scgd.It Pa /usr/share/dict/words
88dab5e017Scgdthe dictionary
89dab5e017Scgd.El
90dab5e017Scgd.Sh COMPATIBILITY
91dab5e017ScgdThe original manual page stated that tabs and blank characters participated
92dab5e017Scgdin comparisons when the
93dab5e017Scgd.Fl d
94dab5e017Scgdoption was specified.
95dab5e017ScgdThis was incorrect and the current man page matches the historic
96dab5e017Scgdimplementation.
9776215250Sjoerg.Sh SEE ALSO
9876215250Sjoerg.Xr grep 1 ,
9976215250Sjoerg.Xr sort 1
100dab5e017Scgd.Sh HISTORY
1017eabdb0eSlukem.Nm
102dc026e05Sfairappeared in
103dc026e05Sfair.At v7 .
104