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
Answers were Sorted based on User's Feedback
Answer / apurba
Answer is B (searches for lines containing the pattern
first in the files second, third, and /usr/you/myfile and
prints them)
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / brijmohan
None of the option will work.
Because "grep first second third" this command will search
for the same pattern and but it should grep "first second
third" instead of grep first second third.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / thajudeen
answer is E none of the above as it will search the pattern
as a single pattern "first second third"
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / 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 |
How does the user view the contents of a text file in UNIX?
What Is the command to change a file's creation time. means one file is created at the time 15:19 then time should br changed to 14:14
What does touch command do in unix?
How can we use grep command in unix?
Suppose 1000 processes are running on the system out of those if you have to show only certain process ids which command will you use?
How does one process we can start an executable file? How to get the PID process, which we started?
What difference between cmp and diff commands?
Give Command that will move a single file called "unix.txt"
Why is awk called awk?
Which command is used to copy files?
the difference between a soft link and a hard link?
How to check the flavor of UNIX?