]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/look.1
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
[thirdparty/util-linux.git] / misc-utils / look.1
CommitLineData
6dbe3af9
KZ
1.\" Copyright (c) 1990, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)look.1 8.1 (Berkeley) 6/14/93
33.\"
232dc924 34.TH LOOK 1 "June 2011" "util-linux" "User Commands"
a5463f78
SK
35.SH NAME
36look \- display lines beginning with a given string
37.SH SYNOPSIS
38.B look
f49ccec2
BS
39[options]
40.IR "string " [ file ]
a5463f78 41.SH DESCRIPTION
f49ccec2 42The
a5463f78 43.B look
6dbe3af9 44utility displays any lines in
a5463f78 45.I file
6dbe3af9 46which contain
c5f29f23 47.IR string .
6dbe3af9 48As
a5463f78 49.B look
6dbe3af9 50performs a binary search, the lines in
a5463f78 51.I file
7ab71099
BS
52must be sorted (where
53.BR sort (1)
54was given the same options
c5f29f23 55.BR "\-d " and/or " \-f " that
a5463f78 56.B look
eb63b9b8 57is invoked with).
a5463f78 58.PP
6dbe3af9 59If
56cdb3f3 60.I file
6dbe3af9 61is not specified, the file
56cdb3f3 62.I /usr/share/dict/words
6dbe3af9
KZ
63is used, only alphanumeric characters are compared and the case of
64alphabetic characters is ignored.
a5463f78
SK
65.SH OPTIONS
66.TP
c5f29f23
BS
67.BR \-a , " \-\-alternative"
68Use the alternative dictionary file.
a5463f78 69.TP
c5f29f23 70.BR \-d , " \-\-alphanum"
eb024893 71Use normal dictionary character set and order, i.e., only blanks and
9b480fe6
KZ
72alphanumeric characters are compared. This is on by default if no file is
73specified.
74
75Note that blanks have been added to dictionary character set for
76compatibility with \fBsort \-d\fR command since version 2.28.
a5463f78 77.TP
c5f29f23 78.BR \-f , " \-\-ignore\-case"
9b480fe6
KZ
79Ignore the case of alphabetic characters. This is on by default if no file is
80specified.
a5463f78 81.TP
c5f29f23 82.BR \-t , " \-\-terminate " \fIcharacter\fR
eb024893 83Specify a string termination character, i.e., only the characters
c5f29f23 84in \fIstring\fR up to and including the first occurrence of \fIcharacter\fR
6dbe3af9 85are compared.
a5463f78 86.TP
c5f29f23 87.BR \-V , " \-\-version"
b4362b6f 88Display version information and exit.
7ab71099
BS
89.TP
90.BR \-h , " \-\-help"
91Display help text and exit.
a5463f78 92.PP
c5f29f23
BS
93The
94.B look
95utility exits 0 if one or more lines were found and displayed, 1 if
a5463f78 96no lines were found, and >1 if an error occurred.
a653878c
SK
97.SH ENVIRONMENT
98.TP
99.B WORDLIST
100Path to a dictionary file. The environment variable has greater priority
101than the dictionary path defined in FILES segment.
a5463f78 102.SH FILES
a5463f78 103.IP "\fB/usr/share/dict/words\fR" 4
6dbe3af9 104the dictionary
a5463f78 105.IP "\fB/usr/share/dict/web2\fR" 4
c5f29f23 106the alternative dictionary
a5463f78 107.SH HISTORY
0791a058 108The
c5f29f23 109.B look
0791a058 110utility appeared in Version 7 AT&T Unix.
67e63c12
MK
111.SH EXAMPLE
112.RS
113.nf
114sort \-d /etc/passwd \-o /tmp/look.dict
115look \-t: root:foobar /tmp/look.dict
116.nf
117.RE
ade04bb8
MK
118.SH SEE ALSO
119.BR grep (1),
120.BR sort (1)
a5463f78 121.SH AVAILABILITY
601d12fb 122The look command is part of the util-linux package and is available from
d673b74e 123https://www.kernel.org/pub/linux/utils/util-linux/.