summaryrefslogtreecommitdiff
path: root/static/unix-v10/man1/look.1
blob: 9db99ab5a9febccf5bb7cc5f87f5b6b51fe8a3e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.TH LOOK 1
.CT 1 files
.SH NAME
look \(mi find lines in a sorted list
.SH SYNOPSIS
.B look
[
.BI -dfnixt c
]
[
.I string
]
[
.I file
]
.SH DESCRIPTION
.I Look
consults a sorted
.I file
and prints all lines that begin with
.IR string .
It uses binary search.
.PP
The following options are recognized.
Options
.BI dfnt c
affect comparisons as in
.IR  sort (1).
.TP
.B -i
Interactive.
There is no
.I string
argument; instead
.I look
takes lines from the standard input as strings to be looked up.
.TP
.B -x
Exact.
Print only lines of the file whose key matches
.I string
exactly.
.TP
.B  -d
`Directory' order:
only letters, digits,
tabs and blanks participate in comparisons.
.TP
.B  -f
Fold.
Upper case letters compare equal to lower case.
.TP
.B -n
Numeric comparison with initial string of digits, optional minus sign,
and optional decimal point.
.TP
.BI -t c
`Tab character'
.I c
terminates the sort key in the
.I file.
.PP
If no
.I file
is specified,
.F /usr/dict/words
is assumed, with collating sequence
.BR df .
.SH FILES
.F /usr/dict/words
.SH "SEE ALSO"
.IR sort (1), 
.IR gre (1), 
.IR dict (7)
.SH DIAGNOSTICS
.I Look
returns exit status 0 if
.I string
is found, 1 if not found, 2 for error.