235 lines
3.8 KiB
HTML
235 lines
3.8 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LOOK</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LOOK</H1>
|
|
Section: User Commands (1)<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
<BR>BSD mandoc<BR>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
|
|
|
|
<B>look</B>
|
|
|
|
- display lines beginning with a given string
|
|
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B></B>
|
|
|
|
|
|
[-<B>bdf</B>
|
|
|
|
]
|
|
|
|
[-<B>t </B><I>termchar</I>
|
|
|
|
|
|
|
|
]
|
|
|
|
<I>string</I>
|
|
|
|
[<I>file ...</I>
|
|
|
|
]
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B></B>
|
|
|
|
|
|
utility displays any lines in
|
|
<I>file</I>
|
|
|
|
which contain
|
|
<I>string</I>
|
|
|
|
as a prefix.
|
|
<P>
|
|
|
|
If
|
|
<I>file</I>
|
|
|
|
is not specified, the file
|
|
/usr/share/dict/words
|
|
|
|
is used, only alphanumeric characters are compared and the case of
|
|
alphabetic characters is ignored.
|
|
<P>
|
|
|
|
The following options are available:
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="1"><B>-b, -binary</B>
|
|
|
|
|
|
<DD>
|
|
Use a binary search on the given word list. If you are ignoring case with
|
|
-<B>f</B>
|
|
|
|
or ignoring non-alphanumeric characters with
|
|
-<B>d</B>
|
|
|
|
|
|
the file must be sorted in the same way. Please note that these options are the
|
|
default if no filename is given. See
|
|
<A HREF="/cgi-bin/man/man2html?1+sort">sort</A>(1)
|
|
|
|
|
|
for more information on sorting files.
|
|
<DT id="2"><B>-d , -alphanum</B>
|
|
|
|
|
|
<DD>
|
|
Dictionary character set and order, i.e., only alphanumeric characters
|
|
are compared.
|
|
<DT id="3"><B>-f , -ignore-case</B>
|
|
|
|
|
|
<DD>
|
|
Ignore the case of alphabetic characters.
|
|
<DT id="4"><B>-t , -terminate </B><I>termchar</I>
|
|
|
|
|
|
|
|
|
|
<DD>
|
|
Specify a string termination character, i.e., only the characters
|
|
in
|
|
<I>string</I>
|
|
|
|
up to and including the first occurrence of
|
|
<I>termchar</I>
|
|
|
|
are compared.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
The
|
|
<B>LANG , LC_ALL</B>
|
|
|
|
and
|
|
<B>LC_CTYPE</B>
|
|
|
|
environment variables affect the execution of the
|
|
<B></B>
|
|
|
|
|
|
utility.
|
|
Their effect is described in
|
|
<A HREF="/cgi-bin/man/man2html?7+environ">environ</A>(7).
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<DL COMPACT>
|
|
<P>
|
|
|
|
<DT id="5"><B>/usr/share/dict/words
|
|
|
|
</B>
|
|
<DD>
|
|
the dictionary
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXIT STATUS</H2>
|
|
|
|
The
|
|
<B></B>
|
|
|
|
|
|
utility exits 0 if one or more lines were found and displayed,
|
|
1 if no lines were found, and >1 if an error occurred.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COMPATIBILITY</H2>
|
|
|
|
The original manual page stated that tabs and blank characters participated
|
|
in comparisons when the
|
|
-<B>d</B>
|
|
|
|
option was specified.
|
|
This was incorrect and the current man page matches the historic
|
|
implementation.
|
|
<P>
|
|
|
|
<B></B>
|
|
|
|
|
|
uses a linear search by default instead of a binary search, which is what most
|
|
other implementations use by default.
|
|
<P>
|
|
|
|
The
|
|
-<B>a</B>
|
|
|
|
and
|
|
-<B>-alternative</B>
|
|
|
|
flags are ignored for compatibility.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<A HREF="/cgi-bin/man/man2html?1+grep">grep</A>(1),
|
|
|
|
|
|
<A HREF="/cgi-bin/man/man2html?1+sort">sort</A>(1)
|
|
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>HISTORY</H2>
|
|
|
|
A
|
|
<B></B>
|
|
|
|
|
|
utility appeared in
|
|
AT&T System
|
|
v7 .
|
|
<A NAME="lbAK"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
Lines are not compared according to the current locale's collating
|
|
order.
|
|
Input files must be sorted with
|
|
<B>LC_COLLATE</B>
|
|
|
|
set to
|
|
`C'
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="9"><A HREF="#lbAE">ENVIRONMENT</A><DD>
|
|
<DT id="10"><A HREF="#lbAF">FILES</A><DD>
|
|
<DT id="11"><A HREF="#lbAG">EXIT STATUS</A><DD>
|
|
<DT id="12"><A HREF="#lbAH">COMPATIBILITY</A><DD>
|
|
<DT id="13"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="14"><A HREF="#lbAJ">HISTORY</A><DD>
|
|
<DT id="15"><A HREF="#lbAK">BUGS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:18 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|