2006-12-06 17:25:32 -06:00
|
|
|
.\" Copyright (c) 1990, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)look.1 8.1 (Berkeley) 6/14/93
|
|
|
|
.\"
|
2011-08-18 15:18:34 -05:00
|
|
|
.TH LOOK 1 "June 2011" "util-linux" "User Commands"
|
2011-06-12 13:33:08 -05:00
|
|
|
.SH NAME
|
|
|
|
look \- display lines beginning with a given string
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B look
|
2014-12-14 13:45:29 -06:00
|
|
|
[options]
|
|
|
|
.IR "string " [ file ]
|
2011-06-12 13:33:08 -05:00
|
|
|
.SH DESCRIPTION
|
2014-12-14 13:45:29 -06:00
|
|
|
The
|
2011-06-12 13:33:08 -05:00
|
|
|
.B look
|
2006-12-06 17:25:32 -06:00
|
|
|
utility displays any lines in
|
2011-06-12 13:33:08 -05:00
|
|
|
.I file
|
2006-12-06 17:25:32 -06:00
|
|
|
which contain
|
2011-08-26 08:48:44 -05:00
|
|
|
.IR string .
|
2006-12-06 17:25:32 -06:00
|
|
|
As
|
2011-06-12 13:33:08 -05:00
|
|
|
.B look
|
2006-12-06 17:25:32 -06:00
|
|
|
performs a binary search, the lines in
|
2011-06-12 13:33:08 -05:00
|
|
|
.I file
|
2014-12-14 13:45:31 -06:00
|
|
|
must be sorted (where
|
|
|
|
.BR sort (1)
|
|
|
|
was given the same options
|
2011-08-26 08:48:44 -05:00
|
|
|
.BR "\-d " and/or " \-f " that
|
2011-06-12 13:33:08 -05:00
|
|
|
.B look
|
2006-12-06 17:25:41 -06:00
|
|
|
is invoked with).
|
2011-06-12 13:33:08 -05:00
|
|
|
.PP
|
2006-12-06 17:25:32 -06:00
|
|
|
If
|
2011-08-02 07:56:06 -05:00
|
|
|
.I file
|
2006-12-06 17:25:32 -06:00
|
|
|
is not specified, the file
|
2011-08-02 07:56:06 -05:00
|
|
|
.I /usr/share/dict/words
|
2006-12-06 17:25:32 -06:00
|
|
|
is used, only alphanumeric characters are compared and the case of
|
|
|
|
alphabetic characters is ignored.
|
2011-06-12 13:33:08 -05:00
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2011-08-26 08:48:44 -05:00
|
|
|
.BR \-a , " \-\-alternative"
|
|
|
|
Use the alternative dictionary file.
|
2011-06-12 13:33:08 -05:00
|
|
|
.TP
|
2011-08-26 08:48:44 -05:00
|
|
|
.BR \-d , " \-\-alphanum"
|
2019-12-14 16:42:47 -06:00
|
|
|
Use normal dictionary character set and order, i.e., only blanks and
|
2016-03-09 08:51:28 -06:00
|
|
|
alphanumeric characters are compared. This is on by default if no file is
|
|
|
|
specified.
|
|
|
|
|
|
|
|
Note that blanks have been added to dictionary character set for
|
|
|
|
compatibility with \fBsort \-d\fR command since version 2.28.
|
2011-06-12 13:33:08 -05:00
|
|
|
.TP
|
2011-08-26 08:48:44 -05:00
|
|
|
.BR \-f , " \-\-ignore\-case"
|
2016-03-09 08:51:28 -06:00
|
|
|
Ignore the case of alphabetic characters. This is on by default if no file is
|
|
|
|
specified.
|
2011-06-12 13:33:08 -05:00
|
|
|
.TP
|
2011-08-26 08:48:44 -05:00
|
|
|
.BR \-t , " \-\-terminate " \fIcharacter\fR
|
2019-12-14 16:42:47 -06:00
|
|
|
Specify a string termination character, i.e., only the characters
|
2011-08-26 08:48:44 -05:00
|
|
|
in \fIstring\fR up to and including the first occurrence of \fIcharacter\fR
|
2006-12-06 17:25:32 -06:00
|
|
|
are compared.
|
2011-06-12 13:33:08 -05:00
|
|
|
.TP
|
2011-08-26 08:48:44 -05:00
|
|
|
.BR \-V , " \-\-version"
|
2013-10-14 14:34:39 -05:00
|
|
|
Display version information and exit.
|
2014-12-14 13:45:31 -06:00
|
|
|
.TP
|
|
|
|
.BR \-h , " \-\-help"
|
|
|
|
Display help text and exit.
|
2011-06-12 13:33:08 -05:00
|
|
|
.PP
|
2011-08-26 08:48:44 -05:00
|
|
|
The
|
|
|
|
.B look
|
|
|
|
utility exits 0 if one or more lines were found and displayed, 1 if
|
2011-06-12 13:33:08 -05:00
|
|
|
no lines were found, and >1 if an error occurred.
|
2017-08-12 03:31:11 -05:00
|
|
|
.SH ENVIRONMENT
|
|
|
|
.TP
|
|
|
|
.B WORDLIST
|
|
|
|
Path to a dictionary file. The environment variable has greater priority
|
|
|
|
than the dictionary path defined in FILES segment.
|
2011-06-12 13:33:08 -05:00
|
|
|
.SH FILES
|
|
|
|
.IP "\fB/usr/share/dict/words\fR" 4
|
2006-12-06 17:25:32 -06:00
|
|
|
the dictionary
|
2011-06-12 13:33:08 -05:00
|
|
|
.IP "\fB/usr/share/dict/web2\fR" 4
|
2011-08-26 08:48:44 -05:00
|
|
|
the alternative dictionary
|
2011-06-12 13:33:08 -05:00
|
|
|
.SH HISTORY
|
2011-02-27 09:28:14 -06:00
|
|
|
The
|
2011-08-26 08:48:44 -05:00
|
|
|
.B look
|
2011-02-27 09:28:14 -06:00
|
|
|
utility appeared in Version 7 AT&T Unix.
|
2020-05-25 07:59:12 -05:00
|
|
|
.SH EXAMPLES
|
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.
In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.
One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.
Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
[Apply patch]
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
$ diff a b
$ echo $?
0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 02:28:32 -05:00
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
sort \-d /etc/passwd \-o /tmp/look.dict
|
|
|
|
look \-t: root:foobar /tmp/look.dict
|
2020-06-10 18:57:22 -05:00
|
|
|
.fi
|
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.
In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.
One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.
Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
[Apply patch]
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
$ diff a b
$ echo $?
0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 02:28:32 -05:00
|
|
|
.RE
|
2020-05-21 02:28:21 -05:00
|
|
|
.SH SEE ALSO
|
|
|
|
.BR grep (1),
|
|
|
|
.BR sort (1)
|
2011-06-12 13:33:08 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The look command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|