| Snaprecruit.com

| Snaprecruit.com

Interview question based on skill :

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

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?

Correct Answer is : -i

3. Which option is used with grep command for deleting lines?

Correct Answer is : -v

4. Which option is used for displaying the line numbers containing the pattern along with lines?

Correct Answer is : -n

5. ______ option counts the number of lines containing the pattern?

Correct Answer is : -c

6. Which option displays only the filename containing the pattern?

Correct Answer is : -l

7. _____ option is used when we need to match multiple patterns in a single invocation of grep command?

Correct Answer is : -e

8. For taking patterns from a file, -f option is specified with grep command.

Correct Answer is : TRUE

9. POSIX identifies regular expressions as belonging to ____ categories.

Correct Answer is : 2

10. grep command supports both extended and regular expressions.

Correct Answer is : TRUE

11. Which of the following is not a subset of BRE (basic regular expression) character subset?

Correct Answer is : ch+

12. Character class is used for matching a group of characters enclosed within a pair of _____

Correct Answer is : [ ]

13. The following command will match ‘Agarwal’, ‘agarwal’ and ‘agrawal’. $ grep “[aA]g[ar][ar]wal” emp.lst

Correct Answer is : TRUE

14. Which of the following symbol is used for matching the immediately preceding character?

Correct Answer is : *

15. Which symbol is used for matching a single character?

Correct Answer is : .

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

Correct Answer is : TRUE

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?

Correct Answer is : -E

20. Which of the following symbols are used for matching multiple patterns?

Correct Answer is : ( and )