look(1) User Commands look(1)NAME
look - find words in the system dictionary or lines in a sorted list
SYNOPSIS
/usr/bin/look [-d] [-f] [-tc] string [filename]
DESCRIPTION
The look command consults a sorted filename and prints all lines that begin with string.
If no filename is specified, look uses /usr/share/lib/dict/words with collating sequence -df.
look limits the length of a word to search for to 256 characters.
OPTIONS -d Dictionary order. Only letters, digits, TAB and SPACE characters are used in comparisons.
-f Fold case. Upper case letters are not distinguished from lower case in comparisons.
-tc Set termination character. All characters to the right of c in string are ignored.
FILES
/usr/share/lib/dict/words spelling list
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO grep(1), sort(1), attributes(5)SunOS 5.11 29 Mar 1994 look(1)
Check Out this Related Man Page
LOOK(1) General Commands Manual LOOK(1)NAME
look - find lines in a sorted list
SYNOPSIS
look [ -dfnixtc ] [ string ] [ file ]
DESCRIPTION
Look consults a sorted file and prints all lines that begin with string. It uses binary search.
The following options are recognized. Options dfnt affect comparisons as in sort(1).
-i Interactive. There is no string argument; instead look takes lines from the standard input as strings to be looked up.
-x Exact. Print only lines of the file whose key matches string exactly.
-d `Directory' order: only letters, digits, tabs and blanks participate in comparisons.
-f Fold. Upper case letters compare equal to lower case.
-n Numeric comparison with initial string of digits, optional minus sign, and optional decimal point.
-t[c] Character c terminates the sort key in the file. By default, tab terminates the key. If c is missing the entire line comprises the
key.
If no file is specified, /lib/words is assumed, with collating sequence df.
FILES
/lib/words
SOURCE
/src/cmd/look.c
SEE ALSO sort(1), grep(1)DIAGNOSTICS
The exit status is ``not found'' if no match is found, and ``no dictionary'' if file or the default dictionary cannot be opened.
LOOK(1)
Hello,
I have a name file in Unix for example : ABC_TODAYFirst.001 and I want just capture or display the 3 first letters so : ABC.
I tried with cut -c,1-3 and the name but it displays the 3 first letters of all lines.
Can you help , Thanks a lot (8 Replies)
Hi,
I just want to search a file for any words containng a capital letter and then display these words only as a list
I have been trying grep but to no has not helped.(im using the bash shell) (7 Replies)
Hi
I would like know how can write a script for find a string between two words.
My input like this:
a1 IN a1a1a1a1a1a1 OUT
b1 IN b1b1b1b1b1b1 OUT
c1 IN c1c1c1c1c1c1 OUT
.
.
.
now my out put like:
a1a1a1a1a1a1
b1b1b1b1b1b1
c1c1c1c1c1c1
please help on this. (6 Replies)
Hi all,
Is anyone able to help with the following query?
I have an input file with several lines of words, e.g.
"hellolaylahello"
"hellohellohellolayla"
I want to search for the exact string "hello" in each line and display:
2 "hellolaylahello"
3 "hellohellohellolayla"
I... (11 Replies)
Hi
I am a little stuck using grep. I want to be able to find from a file all lines which have the sequence of characters t, followed by any character, followed by the characters ing.
I have tried looking at the man pages for help, but did not understand it correctly (as it is not the most... (9 Replies)
I'm trying to find the longest word in /usr/share/dict/words
The first thing I can think of is to sort the content by length then it would be easy to find out, but then i realize theres no option of sort to sort by length.
Could you guys please give me some help?:confused: (7 Replies)
Hi All,
I have a requirement as below
I need find for a string in a log file and once i found that string i need to send a mail.Thsi can be done thru grep and mailx cmnd.
Here once i found the string i need to send last 50 lines(up) from where string found.
Actually they require to find... (9 Replies)
Morning Guys & Gals,
I am trying to figure out a way to remove lines from a file that have more than
2 identical characters in sequence..
So if for instance the list would look like ;
the output would be ;
I can't seem to get my head around perl (among many other... (7 Replies)
hello guys
i need a command that take the words from multiple files and put them in another file this way: one word needs to appear only once in the destination file with small letters no matter how it appears in source files , the words from destination file needs to be alphabetical ordered and... (10 Replies)
I want to sort a file with a list of words, in order of most occuring words to least occurring words as well as alphabetically.
ex:
file1:
cat 3
cat 7
cat 1
dog 3
dog 5
dog 9
dog 1
ape 4
ape 2
I want the outcome to be:
file1.sorted:
dog 1 (12 Replies)
Hi Experts,
How to sepearate the list digit with letters : with a space from where the letters begins, or other words from where the digits ended.
file
52087mo(enbatl)
52049mo(enbatl)
52085mo(enbatl)
25051mo(enbatl)
The output should be looks like:
52087 mo(enbatl)
52049... (10 Replies)
Being new to the forum, I tried finding a solution to find files containing 2 words not necessarily on the same line.
This thread
"List all file names that contain two specific words."
answered it in part, but I was looking for a more concise solution.
Here's a one-line suggestion... (8 Replies)
I am trying to write a command and need to count all the words within the file which begin with the letter S
I have run this command
$ grep '^' TheAgileApproach.dat | wc -l
0
$ grep '^' TheAgileApproach.dat | wc -l
1
When I remove the wc -l I see the output as below:
$ grep '^'... (7 Replies)