| 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. What is the output of the following command? $ wc -c *.c

Correct Answer is : total size of .c files

2. In a pipeline, the command on the left of | must use standard output and one on the right must use standard input.

Correct Answer is : TRUE

3. Which command saves one copy of character stream in a file and store the other to standard output?

Correct Answer is : tee

4. tee is an internal command.

Correct Answer is : FALSE

5. Which of the following is not true about tee command?

Correct Answer is : it is a feature of the shell

6. Apart from its use in redirection, /dev/tty can also be used as an argument to some commands.

Correct Answer is : TRUE

7. Which of the following commands is known as stream editor?

Correct Answer is : sed

8. What is the correct syntax for using sed?

Correct Answer is : sed options ‘address action’ file(s)

9. Which one of the following command will be used for quitting after selecting 3 lines from file emp.lst?

Correct Answer is : sed ‘3q’ emp.lst

10. Which of the following command is used with sed for outputting as well as printing the selected lines?

Correct Answer is : p

11. To suppress the behavior of ‘p’ command of sed, we use ____ option.

Correct Answer is : -n

12. The command $ sed -n ‘$p’ emp.lst will display the last line.

Correct Answer is : TRUE

13. Consider the following commands. $ sed -n ‘1,2p’ emp.lst $ sed -n ‘3,$!p’ emp.lst The output of both commands will be the same.

Correct Answer is : TRUE

14. Which option is used with sed for using multiple instructions?

Correct Answer is : –f and -e

15. ____ option is used for taking instructions from a file.

Correct Answer is : -f

16. To perform context addressing, we have to enclose the pattern in ____

Correct Answer is : / /

17. To select lines containing gupta and agarwal, which command will be used?

Correct Answer is : sed -n ‘/gupta/,/agarwal/p’ emp.lst

18. To write selected lines, ____ is used with sed.

Correct Answer is : w

19. sed can also perform the substitution.

Correct Answer is : TRUE

20. Which one of the following is the correct syntax for performing substitution using sed?

Correct Answer is : sed [address]s /expr1/ expr2/ flags