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.10 29 Mar 1994 look(1)
Check Out this Related Man Page
look(1) General Commands Manual look(1)NAME
look - Finds lines in a sorted list
SYNOPSIS
look [-df] [-tcharacter] string [file]
The look command prints all lines in a sorted file that begin with string.
OPTIONS
Uses dictionary order; only letters, digits, tabs, and spaces are used in comparisons. Searches without regard to case; treats uppercase
and lowercase as equivalent. Ignores character and characters following it in the search string. If you specify look -tC ABCDE, the
string ABCDE would become (in effect) AB, with CDE being ignored. This option is primarily for shell scripts, in which more than one
string is being processed.
DESCRIPTION
If no file is specified, look searches in the system word list /usr/share/dict/words, with the options -df assumed by default.
The look command uses binary search.
The -d and -f options affect comparisons as in sort.
NOTES
In order to use the -f option, you must first sort file with the sort -f command; otherwise, look displays only lowercase items.
If you do not specify -f, but specify a file (such as /usr/share/dict/words) that has been sorted with sort -f, look may not produce any
output.
EXAMPLES
To search a sorted file called sortfile for all lines that begin with the string as, enter: look as sortfile To search the system word list
for all words beginning with smi, enter: look smi
This might result in: smile smirk smith smithereens Smithfield Smithson smithy smitten
FILES
System word list.
SEE ALSO
Commands: grep(1), sort(1), spell(1)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
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)