1LOOK(1) User Commands LOOK(1)
2
3
4
6 look - display lines beginning with a given string
7
9 look [options] string [file]
10
12 The look utility displays any lines in file which contain string. As
13 look performs a binary search, the lines in file must be sorted (where
14 sort(1) was given the same options -d and/or -f that look is invoked
15 with).
16
17 If file is not specified, the file /usr/share/dict/words is used, only
18 alphanumeric characters are compared and the case of alphabetic
19 characters is ignored.
20
22 -a, --alternative
23 Use the alternative dictionary file.
24
25 -d, --alphanum
26 Use normal dictionary character set and order, i.e., only blanks
27 and alphanumeric characters are compared. This is on by default if
28 no file is specified.
29
30 Note that blanks have been added to dictionary character set for
31 compatibility with sort -d command since version 2.28.
32
33 -f, --ignore-case
34 Ignore the case of alphabetic characters. This is on by default if
35 no file is specified.
36
37 -t, --terminate character
38 Specify a string termination character, i.e., only the characters
39 in string up to and including the first occurrence of character are
40 compared.
41
42 -V, --version
43 Display version information and exit.
44
45 -h, --help
46 Display help text and exit.
47
48 The look utility exits 0 if one or more lines were found and displayed,
49 1 if no lines were found, and >1 if an error occurred.
50
52 WORDLIST
53 Path to a dictionary file. The environment variable has greater
54 priority than the dictionary path defined in FILES segment.
55
57 /usr/share/dict/words
58 the dictionary
59
60 /usr/share/dict/web2
61 the alternative dictionary
62
64 The look utility appeared in Version 7 AT&T Unix.
65
67 sort -d /etc/passwd -o /tmp/look.dict
68 look -t: root:foobar /tmp/look.dict
69
71 grep(1), sort(1)
72
74 For bug reports, use the issue tracker at
75 https://github.com/karelzak/util-linux/issues.
76
78 The look command is part of the util-linux package which can be
79 downloaded from Linux Kernel Archive
80 <https://www.kernel.org/pub/linux/utils/util-linux/>.
81
82
83
84util-linux 2.37.2 2021-06-02 LOOK(1)