]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/look.1.adoc
Merge branch 'getwc' of https://github.com/t-8ch/util-linux
[thirdparty/util-linux.git] / misc-utils / look.1.adoc
1 //po4a: entry man manual
2 ////
3 Copyright (c) 1990, 1993
4 The Regents of the University of California. All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9 1. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 3. All advertising materials mentioning features or use of this software
15 must display the following acknowledgement:
16 This product includes software developed by the University of
17 California, Berkeley and its contributors.
18 4. Neither the name of the University nor the names of its contributors
19 may be used to endorse or promote products derived from this software
20 without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 SUCH DAMAGE.
33
34 @(#)look.1 8.1 (Berkeley) 6/14/93
35 ////
36 = look(1)
37 :doctype: manpage
38 :man manual: User Commands
39 :man source: util-linux {release-version}
40 :page-layout: base
41 :command: look
42
43 == NAME
44
45 look - display lines beginning with a given string
46
47 == SYNOPSIS
48
49 *look* [options] _string_ [_file_]
50
51 == DESCRIPTION
52
53 The *look* utility displays any lines in _file_ which contain _string_ as a prefix. As *look* performs a binary search, the lines in _file_ must be sorted (where *sort*(1) was given the same options *-d* and/or *-f* that *look* is invoked with).
54
55 If _file_ is not specified, the file _/usr/share/dict/words_ is used, only alphanumeric characters are compared and the case of alphabetic characters is ignored.
56
57 == OPTIONS
58
59 *-a*, *--alternative*::
60 Use the alternative dictionary file.
61
62 *-d*, *--alphanum*::
63 Use normal dictionary character set and order, i.e., only blanks and alphanumeric characters are compared. This is on by default if no file is specified.
64 +
65 Note that blanks have been added to dictionary character set for compatibility with *sort -d* command since version 2.28.
66
67 *-f*, *--ignore-case*::
68 Ignore the case of alphabetic characters. This is on by default if no file is specified.
69
70 *-t*, *--terminate* _character_::
71 Specify a string termination character, i.e., only the characters in _string_ up to and including the first occurrence of _character_ are compared.
72
73 include::man-common/help-version.adoc[]
74
75 The *look* utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred.
76
77 == ENVIRONMENT
78
79 *WORDLIST*::
80 Path to a dictionary file. The environment variable has greater priority than the dictionary path defined in the *FILES* segment.
81
82 == FILES
83
84 _/usr/share/dict/words_::
85 the dictionary
86
87 _/usr/share/dict/web2_::
88 the alternative dictionary
89
90 == HISTORY
91
92 The *look* utility appeared in Version 7 AT&T Unix.
93
94 == EXAMPLES
95
96 ....
97 sort -d /etc/passwd -o /tmp/look.dict
98 look -t: root:foobar /tmp/look.dict
99 ....
100
101 == SEE ALSO
102
103 *grep*(1),
104 *sort*(1)
105
106 include::man-common/bugreports.adoc[]
107
108 include::man-common/footer.adoc[]
109
110 ifdef::translation[]
111 include::man-common/translation.adoc[]
112 endif::[]