Google News
logo
Unix - Quiz(MCQ)
Which of the following command will be used for searching "director" in emp.lst?
A)
grep “director”
B)
grep -director emp.lst
C)
grep -v “director” emp.lst
D)
grep “director” emp.lst

Correct Answer :   grep “director” emp.lst


Explanation : Because grep command is also a filter, it can search it’s standard input for the pattern. For example, the command grep “director” emp.lst will search the file emp.lst for the pattern “director” and will display the lines containing this pattern.

Advertisement