]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/look.1.adoc
misc: non-Linux portability fixes
[thirdparty/util-linux.git] / misc-utils / look.1.adoc
CommitLineData
295b3979 1//po4a: entry man manual
6c64d12d
MB
2////
3Copyright (c) 1990, 1993
4 The Regents of the University of California. All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions
8are met:
91. Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
112. 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.
143. 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.
184. 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
22THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32SUCH 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
45look - display lines beginning with a given string
46
47== SYNOPSIS
48
49*look* [options] _string_ [_file_]
50
51== DESCRIPTION
52
1a48eee7 53The *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).
6c64d12d
MB
54
55If _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*::
2c646c80 60Use the alternative dictionary file.
6c64d12d
MB
61
62*-d*, *--alphanum*::
2c646c80
MB
63Use 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+
65Note that blanks have been added to dictionary character set for compatibility with *sort -d* command since version 2.28.
6c64d12d
MB
66
67*-f*, *--ignore-case*::
2c646c80 68Ignore the case of alphabetic characters. This is on by default if no file is specified.
6c64d12d
MB
69
70*-t*, *--terminate* _character_::
2c646c80 71Specify a string termination character, i.e., only the characters in _string_ up to and including the first occurrence of _character_ are compared.
6c64d12d
MB
72
73*-V*, *--version*::
2c646c80 74Display version information and exit.
6c64d12d
MB
75
76*-h*, *--help*::
2c646c80 77Display help text and exit.
6c64d12d
MB
78
79The *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.
80
81== ENVIRONMENT
82
83*WORDLIST*::
c83a52f0 84Path to a dictionary file. The environment variable has greater priority than the dictionary path defined in the *FILES* segment.
6c64d12d
MB
85
86== FILES
87
88_/usr/share/dict/words_::
2c646c80 89the dictionary
6c64d12d
MB
90
91_/usr/share/dict/web2_::
2c646c80 92the alternative dictionary
6c64d12d
MB
93
94== HISTORY
95
96The *look* utility appeared in Version 7 AT&T Unix.
97
98== EXAMPLES
99
100....
101sort -d /etc/passwd -o /tmp/look.dict
102look -t: root:foobar /tmp/look.dict
103....
104
105== SEE ALSO
106
107*grep*(1),
108*sort*(1)
109
625e9c61 110include::man-common/bugreports.adoc[]
6c64d12d 111
625e9c61 112include::man-common/footer.adoc[]
6c64d12d
MB
113
114ifdef::translation[]
625e9c61 115include::man-common/translation.adoc[]
6c64d12d 116endif::[]