UTERMINAL
TERMINAL
NEXT
$V1$
PAUSE
BOTCLEAN
ENCORE5
CLEAN
ENCORE
BOX
COMMAND
GO
grep
SYNTAX
grep [-options] expression [files]
FUNCTION
grep searches the input file for lines containing
the expression.
SOME OPTIONS:
-v - all lines are printed except those with matching text
-l - only the names of files with matching lines
are listed, with each name on a new line
-n - prints the line number along with the line
containing the matching pattern
Let us use the grep command to determine whether the string
lines exists in the above file, and if so to print the line number.
data_file
nl reads lines from
the named file or
standard input if
no file is named,
and reproduces the
lines with numbers
on the standard
output.
Please enter the command to look for lines containing the word
lines in the above file and print the line number(s).
Enter here:
That is correct!
You've got it on the 2nd try.
Good, you understand the concept.
Please use grep with the -n option for data_file
Please type grep -n lines data_file
I guess I must type this for you:
FORGET1
grep -n lines data_file
Observe the result above.
1:nl reads lines from
6:lines with numbers