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 “chmod” command?
What is s and g in sed command?
What are the dos commands?
Who command in unix operating system?
How to display no of records in oracle using unix command?
What is awk good for?
What does the metacharacter mean?
Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?
Is command prompt unix?
How can you see the command line history?
What is difference between grep and find command in unix?
how to sort the content of the file based on numeric values
Which command is used to restrict incoming messages?
How do I open a port?
What is merge command in unix?