MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Unix knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
_____OPTION_IS_USED_FOR_TAKING_INSTRUCTIONS_FROM_A_FILE.?$ |
| A. | -f |
| B. | -e |
| C. | -i |
| D. | -n |
| Answer» D. -n | |
| 2. |
WHICH_OPTION_IS_USED_WITH_SED_FOR_USING_MULTIPLE_INSTRUCTIONS??$ |
| A. | -f |
| B. | -n |
| C. | -e |
| D. | –f and -e |
| Answer» B. -n | |
| 3. |
To select lines containing gupta and agarwal, which command will be used?$ |
| A. | sed -n ‘/gupta/,/agarwal/p’ emp.lst |
| B. | sed -n ‘/gupta/agarwal/p’ emp.lst |
| C. | sed ‘/gupta | agarwal’p’ emp.lst |
| D. | sed -n |
| Answer» D. sed -n | |
| 4. |
To perform context addressing, we have to enclose the pattern in ____$ |
| A. | double quotes |
| B. | single quotes |
| C. | / / |
| D. | $ $ |
| Answer» B. single quotes | |
| 5. |
The command $ sed -n ‘$p’ emp.lst will display the last line.$ |
| A. | True |
| B. | False |
| Answer» B. False | |
| 6. |
To suppress the behavior of ‘p’ command of sed, we use ____ option.$ |
| A. | -q |
| B. | -n |
| C. | -i |
| D. | -v |
| Answer» C. -i | |
| 7. |
Which of the following command is used with sed for outputting as well as printing the selected lines? |
| A. | q |
| B. | n |
| C. | p |
| D. | i |
| Answer» D. i | |
| 8. |
Which one of the following command will be used for quitting after selecting 3 lines from file emp.lst? |
| A. | sed -n 3 emp.lst |
| B. | sed -i 1-3 emp.lst |
| C. | sed ‘3q’ emp.lst |
| D. | sed -n |
| Answer» D. sed -n | |
| 9. |
What is the correct syntax for using sed? |
| A. | sed options file(s) |
| B. | sed options ‘action’ |
| C. | sed options ‘address action’ file(s) |
| D. | sed ‘action’ file(s) |
| Answer» D. sed ‚Äö√Ñ√∂‚àö√ë‚àö‚â§action‚Äö√Ñ√∂‚àö√ë‚àö¬• file(s) | |
| 10. |
Which of the following commands is known as stream editor? |
| A. | sed |
| B. | grep |
| C. | grep |
| D. | tr |
| Answer» B. grep | |