Commit | Line | Data |
---|---|---|
dd9e2e8d CL |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
f4cde64a | 3 | .\" |
dd9e2e8d CL |
4 | .\" %sccs.include.redist.man% |
5 | .\" | |
08fc9b74 | 6 | .\" @(#)look.1 6.6 (Berkeley) %G% |
ef1f0408 CL |
7 | .\" |
8 | .Dd | |
9 | .Dt LOOK 1 | |
ee9b0a0a | 10 | .Os |
ef1f0408 CL |
11 | .Sh NAME |
12 | .Nm look | |
13 | .Nd display lines beginning with a given string | |
14 | .Sh SYNOPSIS | |
15 | .Nm look | |
16 | .Op Fl df | |
17 | .Ar string | |
18 | .Op Ar file | |
19 | .Sh DESCRIPTION | |
20 | The | |
08fc9b74 KB |
21 | .Nm look |
22 | utility displays any lines in | |
ef1f0408 | 23 | .Ar file |
08fc9b74 KB |
24 | which contain |
25 | .Ar string | |
26 | as a prefix. | |
27 | As | |
ef1f0408 | 28 | .Nm look |
08fc9b74 KB |
29 | performs a binary search, the lines in |
30 | .Ar file | |
31 | must be sorted. | |
32 | .Pp | |
33 | If | |
ef1f0408 CL |
34 | .Ar file |
35 | is not specified, the file | |
36 | .Pa /usr/share/dict/words | |
08fc9b74 KB |
37 | is used, only alphanumeric characters are compared and the case of |
38 | alphabetic characters is ignored. | |
ef1f0408 CL |
39 | .Pp |
40 | Options: | |
08fc9b74 KB |
41 | .Bl -tag -width Ds |
42 | .It Fl d | |
43 | Dictionary character set and order, i.e. only alphanumeric characters | |
44 | are compared. | |
45 | .It Fl f | |
46 | Ignore the case of alphabetic characters. | |
47 | .El | |
48 | .Pp | |
49 | The | |
50 | .Nm look | |
51 | utility exits 0 if one or more lines were found and displayed, | |
52 | 1 if no lines were found, and >1 if an error occurred. | |
ef1f0408 | 53 | .Sh FILES |
08fc9b74 KB |
54 | .Bl -tag -width /usr/share/dict/words -compact |
55 | .It Pa /usr/share/dict/words | |
56 | the dictionary | |
57 | .El | |
ef1f0408 | 58 | .Sh SEE ALSO |
08fc9b74 KB |
59 | .Xr grep 1 , |
60 | .Xr sort 1 | |
61 | .Sh COMPATIBILITY | |
62 | The original manual page stated that tabs and blank characters participated | |
63 | in comparisons when the | |
64 | .Fl d | |
65 | option was specified. | |
66 | This was incorrect and the current man page matches the historic | |
67 | implementation. | |
ef1f0408 CL |
68 | .Sh HISTORY |
69 | .Nm Look | |
70 | appeared in Version 7 AT&T Unix. |