Answer Posted / kiran sangeri
grep is one of many standard UNIX utilities. It searches
files for specified words or patterns. First clear the
screen, then type
% grep science science.txt
As you can see, grep has printed out each line containg the
word science.
Or has it ????
Try typing
% grep Science science.txt
The grep command is case sensitive; it distinguishes
between Science and science.
To ignore upper/lower case distinctions, use the -i option,
i.e. type
% grep -i science science.txt
To search for a phrase or pattern, you must enclose it in
single quotes (the apostrophe symbol). For example to
search for spinning top, type
% grep -i 'spinning top' science.txt
Some of the other options of grep are:
-v display those lines that do NOT match
-n precede each matching line with the line number
-c print only the total count of matched lines
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How do I find previous commands in unix?
what is the advaantage of each user having its own copy of the shell?
Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?
Name the general commands in using unix os for a beginner?
What is ‘ps’ command for?
What is awk command used for?
Explain how to use grep command to list find the records of a file containing 10 different strings?
Which command is used to copy files?
What is the command to find hidden files in the current directory?
When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system.
How can i findthe right soluion???
My pgm:
#include
How do I delete files from command prompt?
What is the use of cut command in unix?
What are the general commands in using unix os for a beginner?
What difference between cmp and diff commands?
Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?