LOOK(1) BSD General Commands Manual LOOK(1)NAME
look -- display lines beginning with a given string
SYNOPSIS
look [-df] [-t termchar] string [file ...]
DESCRIPTION
The look utility displays any lines in file which contain string as a prefix. As look performs a binary search, the lines in file must be
sorted.
If file is not specified, the file /usr/share/dict/words is used, only alphanumeric characters are compared and the case of alphabetic char-
acters is ignored.
The following options are available:
-d Dictionary character set and order, i.e., only alphanumeric characters are compared.
-f Ignore the case of alphabetic characters.
-t Specify a string termination character, i.e., only the characters in string up to and including the first occurrence of termchar are
compared.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of the look utility. Their effect is described in environ(7).
FILES
/usr/share/dict/words the dictionary
EXIT STATUS
The look utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred.
COMPATIBILITY
The original manual page stated that tabs and blank characters participated in comparisons when the -d option was specified. This was incor-
rect and the current man page matches the historic implementation.
SEE ALSO grep(1), sort(1)HISTORY
A look utility appeared in Version 7 AT&T UNIX.
BUGS
Lines are not compared according to the current locale's collating order. Input files must be sorted with LC_COLLATE set to 'C'.
BSD July 17, 2004 BSD
Check Out this Related Man Page
LOOK(1) BSD General Commands Manual LOOK(1)NAME
look -- display lines beginning with a given string
SYNOPSIS
look [-df] [-t termchar] string [file ...]
DESCRIPTION
The look utility displays any lines in file which contain string as a prefix. As look performs a binary search, the lines in file must be
sorted.
If file is not specified, the file /usr/share/dict/words is used, only alphanumeric characters are compared and the case of alphabetic char-
acters is ignored.
The following options are available:
-d Dictionary character set and order, i.e., only alphanumeric characters are compared.
-f Ignore the case of alphabetic characters.
-t Specify a string termination character, i.e., only the characters in string up to and including the first occurrence of termchar are
compared.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of the look utility. Their effect is described in environ(7).
FILES
/usr/share/dict/words the dictionary
EXIT STATUS
The look utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred.
COMPATIBILITY
The original manual page stated that tabs and blank characters participated in comparisons when the -d option was specified. This was incor-
rect and the current man page matches the historic implementation.
SEE ALSO grep(1), sort(1)HISTORY
A look utility appeared in Version 7 AT&T UNIX.
BUGS
Lines are not compared according to the current locale's collating order. Input files must be sorted with LC_COLLATE set to 'C'.
BSD July 17, 2004 BSD
suppose a name is read
how to check whether the name contains only alphabets and space
not non-alphabetic characters and special characters (5 Replies)
hi,
i have to grep for string in file but i want to find the group of this line so i must get lines before and select the group.
the file look like :
####name_groupe1
alphanumeric line
alphanumeric line
..
####name_groupe2
alphanumeric line
alphanumeric line
..
####name_groupe3... (4 Replies)
Hi all,
I need help in doing this scenario. I have two files with multiple lines. I want to compare these two files but ignoring the lines which have words like Tran, Loc, Addr, Charge. Also if i have a word Credit in line, i want to tokenize (i.e string after character "
... (2 Replies)
I have a file that contains a great number of lines, let's say 183 lines, and I want to add: echo " to the beginning of each line. What is the easiest way to do it?
Tx (9 Replies)
Dear all,
I am stuck while trying to add a string to multiple lines. Let me try to explain using an example:
Input:
--------
myExample_send ("MasterSends",
n,
"Data Type",
MPI_INT);
correct Output:... (4 Replies)
Hi all,
im newbie in unix, i have a case like this
file name : RegisterSubscriber.log
file value :
<errId>0x0509000000000003</errId><HARs><ok/><affectEntity>510890905290059</affectEntity></HLRes></HRI>
I want to grep the line which contain 0x0509000000000003,
and i want to grep... (2 Replies)
. Display a sorted list of all of the files in the current directory and the number of lines and words in each. You should not have ‘total' in your output. (Your script can assume that the current directory contains just files and no subdirectories)
this is what i got so far
wc -l -w * ... (5 Replies)
Hello all. I would need to "grep" a file for the occurrence of all lines listed in another file. The result would be a list of lines extracted from file 1, which contain instances (lines) present in file 2. Could you suggest the command? thanx a lot for help! (2 Replies)
Hey I want to know if there is an option to know the number of lines containing a certain string (bit for example) in a file? Say I want to know number of lines containing only the string BIT in file xyz. I know how to get number of lines in a file by using wc -l but how do you get number of lines... (1 Reply)
am using AIX and I have a string "There is no process to read data written to a pipe". I want to get the output 2 lines before and 4 lines after this string. The string is present like more than 100 times in the log and I want to output, the last result in the log with this string
I tried using... (1 Reply)
i want to search a log for a string. when that string is found, i want to grab the a set number of lines that came before the string, and a set number of lines that come after the string.
so if i search for the word "Error" in the /var/log/messages file, how can I output the 20 lines that came... (4 Replies)
Hi,
I wanted to grep string "ERROR" and "WORNING" after last occurrence of String "Starting" only and wanted to display two lines after searched ERROR and WORNING string and one line before. I have following cronjob log file "errorlog" file and I have written the code for same in Unix as below... (17 Replies)
Hello.
I have a script that writes parameters in alphabetic order.
But I have a parameter which have 3 lines. There is no continuation character ( '\' ). Each of the three lines finish with 'cr'. But line 2 and 3 of the concerning parameter start with a tab char (but should be one or more... (7 Replies)