1. If there are special characters in a pattern, then we’ve to enclose them in ______
Correct Answer is : double quotes
2. Which option is used with grep command for ignoring the case in pattern searching?
3. Which option is used with grep command for deleting lines?
4. Which option is used for displaying the line numbers containing the pattern along with lines?
5. ______ option counts the number of lines containing the pattern?
6. Which option displays only the filename containing the pattern?
7. _____ option is used when we need to match multiple patterns in a single invocation of grep command?
8. For taking patterns from a file, -f option is specified with grep command.
9. POSIX identifies regular expressions as belonging to ____ categories.
10. grep command supports both extended and regular expressions.
11. Which of the following is not a subset of BRE (basic regular expression) character subset?
12. Character class is used for matching a group of characters enclosed within a pair of _____
13. The following command will match ‘Agarwal’, ‘agarwal’ and ‘agrawal’.
$ grep “[aA]g[ar][ar]wal” emp.lst
14. Which of the following symbol is used for matching the immediately preceding character?
15. Which symbol is used for matching a single character?
16. Which of the following symbols are used for matching a pattern at specified locations?
Correct Answer is : ^ and $
17. The following command will match the lines beginning with ‘2’.
$ grep “^2” emp.lst
18. Which of the following symbols are a set of ERE (extended regular expressions)?
Correct Answer is : #NAME?
19. Which option is used when we want to use an ERE with grep command?
20. Which of the following symbols are used for matching multiple patterns?
Correct Answer is : ( and )