]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/look.1
docs: adjust some formatting and wordings in a handful of man pages
[thirdparty/util-linux.git] / misc-utils / look.1
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 .\"
34 .TH LOOK 1 "June 2011" "util-linux" "User Commands"
35 .SH NAME
36 look \- display lines beginning with a given string
37 .SH SYNOPSIS
38 .B look
39 [options]
40 .IR "string " [ file ]
41 .SH DESCRIPTION
42 The
43 .B look
44 utility displays any lines in
45 .I file
46 which contain
47 .IR string .
48 As
49 .B look
50 performs a binary search, the lines in
51 .I file
52 must be sorted (where
53 .BR sort (1)
54 was given the same options
55 .BR "\-d " and/or " \-f " that
56 .B look
57 is invoked with).
58 .PP
59 If
60 .I file
61 is not specified, the file
62 .I /usr/share/dict/words
63 is used, only alphanumeric characters are compared and the case of
64 alphabetic characters is ignored.
65 .SH OPTIONS
66 .TP
67 .BR \-a , " \-\-alternative"
68 Use the alternative dictionary file.
69 .TP
70 .BR \-d , " \-\-alphanum"
71 Use normal dictionary character set and order, i.e. only alphanumeric characters
72 are compared. (This is on by default if no file is specified.)
73 .TP
74 .BR \-f , " \-\-ignore\-case"
75 Ignore the case of alphabetic characters. (This is on by default if no file is
76 specified.)
77 .TP
78 .BR \-t , " \-\-terminate " \fIcharacter\fR
79 Specify a string termination character, i.e. only the characters
80 in \fIstring\fR up to and including the first occurrence of \fIcharacter\fR
81 are compared.
82 .TP
83 .BR \-V , " \-\-version"
84 Display version information and exit.
85 .TP
86 .BR \-h , " \-\-help"
87 Display help text and exit.
88 .PP
89 The
90 .B look
91 utility exits 0 if one or more lines were found and displayed, 1 if
92 no lines were found, and >1 if an error occurred.
93 .SH EXAMPLE
94 .RS
95 .nf
96 sort -d /etc/passwd -o /tmp/look.dict
97 look -t: root:foobar /tmp/look.dict
98 .nf
99 .RE
100 .SH FILES
101 .IX Header "FILES"
102 .IP "\fB/usr/share/dict/words\fR" 4
103 the dictionary
104 .IP "\fB/usr/share/dict/web2\fR" 4
105 the alternative dictionary
106 .SH "SEE ALSO"
107 .BR grep (1),
108 .BR sort (1)
109 .SH COMPATIBILITY
110 The original manual page stated that tabs and blank characters participated
111 in comparisons when the \fB\-\-alphanum\fR option was specified. This was
112 incorrect, and the current man page matches the historic implementation.
113 .SH HISTORY
114 The
115 .B look
116 utility appeared in Version 7 AT&T Unix.
117 .SH AVAILABILITY
118 The look command is part of the util-linux package and is available from
119 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.