~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to misc-utils/look.1

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

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