Commands for Searching, Replacing, and Substituting in Vi Editor MCQSBy: Prof. Dr. Fazal Rehman | Last updated: May 30, 2025 11 Score: 0 Attempted: 0/11 Subscribe 1. : For substitution command, which command do we use? (A) n (B) s (C) N (D) S 2. : To replace ‘professor’ with ‘director’ throughout the whole file, which command do we use? (A) 1,$s/professor/director/g and %s/professor/director/g (B) %s/professor/director/g (C) 1,$s/professor/director (D) 1,$s/professor/director/g 3. : For performing substitution on a file, what is the correct syntax? (A) :address (B) :address/target_pattern source_pattern/flag (C) :address/flag (D) :address/source_pattern/target_pattern/flag 4. : For searching a pattern in vi, which symbol is used? (A) / (B) / and ? (C) % (D) ? 5. : For interactive substitution, which flag do we use? (A) g (B) gc (C) G (D) cg 6. : For repeating the search in the same direction, which command do we use? (A) NN (B) N (C) nn (D) n 7. : For deleting all the instances of the string ‘manager’ in file003, which command do we use? (A) %s/manager/ / (B) %s/manager/director/g (C) 1,$s/professor/director (D) 1,$s/manager/ /g 8. : The invalid command is (A) /printf (B) :1,%/file01/file02/g (C) :%/abd/mash/wc (D) ?scanf 9. : What searches for the first instance of a pattern in the forward direction? (A) & (B) % (C) / (D) ? 10. : What searches for the first instance of a pattern in the backward direction? (A) ? (B) % (C) & (D) / 11. : To reverse the direction of repeating the search, which command do we use? (A) n (B) nn (C) N (D) NN Related Posts:Important MS-DOS Commands, Top 30 CommandsHow to Replacing Line or Paragraph on two or many lines in MS Word?How to make w3schools like tryit editor?Which of the following is the first UNIX editor?Searching and sorting exercises and solutions in C++Sorting and Searching Algorithms MCQs