The command
grep first second third /usr/you/myfile
a) prints lines containing the words first,
second or third from the file /usr/you/myfile
b) searches for lines containing the pattern
first in the files
second, third, and /usr/you/myfile and prints them
c) searches the files /usr/you/myfiel and
third for lines containing
the words first or second and prints them
d) replaces the word first with the word
second in the files third and /usr/you/myfile
e) None of the above
Answer Posted / sathe santosh
The above command will not work.
grep searches the 1st argument in 2nd argument(filename).
The filename has multiple patterns.
example:
cat 1.lst
hi
hello
bye
see the below message.
grep hi hello 1.lst
grep: can't open hello
1.lst:hi
same can be done using below command.
grep -e hi -e hello 1.lst
hi
hello
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What is the pipe command?
Are you in or at the office?
What is a command and examples?
How do you repeat a command in terminal?
What's a command word?
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
What is the general format of unix command syntax?
What are the general commands in using unix os for a beginner?
How can we use grep command in unix?
Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?
How to display no of records in oracle using unix command?
Which command is used to find whether the system is 32 bit or 64 bit?
What is sed awk grep?
What is the difference between cat and more command?
What is difference between grep and find command in unix?