1. Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?
Correct Answer is : 1,$s/professor/director/g and %s/professor/director/g
2. Which of the following flag will be used for interactive substitution?
3. Which one of the following commands will be used to delete all the instances of string ‘manager’ in file003?
Correct Answer is : 1,$s/manager/ /g
4. Which one of the following command is invalid?
Correct Answer is : :1,%/file01/file02/g
5. Search and replace operations can also use regular expressions for matching multiple patterns.
6. Which command is used for comparing two files?
7. What is the exit status of cmp command if both the files are identical?
8. Which option is used with cmp command to display a detailed list of mismatches?
9. Which option is used with cmp command to limit the number of bytes to be compared?
10. How can we skip some initial bytes from both the files to be compared?
Correct Answer is : using -i option
11. -b option is used with cmp command to print the differing bytes in both files.
12. Which command compares two sorted files line by line?
13. What will be the command if we want to suppress column 1 and column 2 in the output of comm Command?
Correct Answer is : comm -12
14. For comm command to work properly, files specified should be sorted.
15. Which command is used to display the differences between files?
16. When two files are identical, what is the output of diff command?
Correct Answer is : Returns prompt
17. Which option is used to produce multi columnar output in diff command?
18. If we are interested in knowing that whether the two files are identical or not, we can use ___ command.
19. Which of the following is used to compress files?
20. Which one of the following extension is provided by gzip to the compressed filename?