InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Search and replace operations can also use regular expressions for matching multiple patterns.(a) True(b) FalseThe question was asked by my college director while I was bunking the class.My doubt stems from Commands for Searching, Replacing and Substituting in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» Correct answer is (a) True |
|
| 2. |
Which one of the following commands will be used to delete all the instances of string ‘manager’ in file003?(a) 1,$s/manager/ /g(b) %s/manager/director/g(c) 1,$s/professor/director(d) %s/manager/ /I have been asked this question during an online interview.I would like to ask this question from Commands for Searching, Replacing and Substituting in Vi Editor in section The Vi Editor of Unix |
|
Answer» The CORRECT OPTION is (a) 1,$s/manager/ /g |
|
| 3. |
Which of the following flag will be used for interactive substitution?(a) g(b) G(c) gc(d) cgThe question was asked by my school teacher while I was bunking the class.I want to ask this question from Commands for Searching, Replacing and Substituting in Vi Editor in section The Vi Editor of Unix |
|
Answer» CORRECT option is (c) gc The best I can explain: For selectively replacing a STRING we can use ‘gc’ flag. Here ‘c’ is used as a confirmatory parameter at the end. Each line is SELECTED in turn and then waits for our response, whether to replace the selected PATTERN or not. A ‘y’ PERFORMS the substitution and any other response doesn’t. |
|
| 4. |
Which of the following is a correct syntax for performing substitution on a file?(a) :address/source_pattern/target_pattern/flag(b) :address/target_pattern source_pattern/flag(c) :address/flag(d) :addressI have been asked this question in an interview for job.My doubt is from Commands for Searching, Replacing and Substituting in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» Correct ANSWER is (a) :address/source_pattern/target_pattern/flag |
|
| 5. |
We cannot leave the flag field empty while performing the substitution.(a) True(b) FalseThe question was posed to me in a national level competition.Query is from Commands for Searching, Replacing and Substituting in Vi Editor topic in section The Vi Editor of Unix |
|
Answer» The correct ANSWER is (b) False |
|
| 6. |
Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?(a) 1,$s/professor/director/g(b) %s/professor/director/g(c) 1,$s/professor/director(d) 1,$s/professor/director/g and %s/professor/director/gThis question was posed to me during an online exam.This is a very interesting question from Commands for Searching, Replacing and Substituting in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» The correct option is (d) 1,$s/professor/director/G and %s/professor/director/g |
|
| 7. |
The target pattern is optional.(a) True(b) FalseThe question was posed to me by my college director while I was bunking the class.This intriguing question originated from Commands for Searching, Replacing and Substituting in Vi Editor in division The Vi Editor of Unix |
|
Answer» Correct ANSWER is (a) True |
|
| 8. |
Which of the following symbol is used for substitution command?(a) n(b) N(c) s(d) SThis question was addressed to me in examination.I'm obligated to ask this question of Commands for Searching, Replacing and Substituting in Vi Editor topic in portion The Vi Editor of Unix |
|
Answer» RIGHT option is (C) s Explanation: For replacing a pattern with ANOTHER pattern we use SUBSTITUTION COMMAND which is represented by ‘s’. |
|
| 9. |
Which command is used for repeating the search in the same direction?(a) n(b) N(c) nn(d) NNI had been asked this question in an online interview.The above asked question is from Commands for Searching, Replacing and Substituting in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» Correct choice is (a) n |
|
| 10. |
Which command is used to reverse the direction of repeating the search?(a) n(b) N(c) nn(d) NNThe question was asked by my college director while I was bunking the class.This interesting question is from Commands for Searching, Replacing and Substituting in Vi Editor topic in section The Vi Editor of Unix |
|
Answer» The CORRECT choice is (b) N |
|
| 11. |
Substitution command is an ex-mode command.(a) True(b) FalseThis question was posed to me in an online quiz.The above asked question is from Commands for Searching, Replacing and Substituting in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» The correct option is (a) True |
|
| 12. |
____ searches for a first instance of a pattern in the backward direction.(a) /(b) %(c) &(d) ?The question was asked during an interview.The query is from Commands for Searching, Replacing and Substituting in Vi Editor topic in portion The Vi Editor of Unix |
|
Answer» Correct option is (d) ? |
|
| 13. |
Which symbol is used for repeating the last command?(a) $(b) *(c) .(d) _I got this question during an interview.The question is from Editing Text in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» The correct CHOICE is (c) . |
|
| 14. |
____ searches for a first instance of a pattern in forwarding direction.(a) /(b) %(c) &(d) ?I have been asked this question during an online interview.Origin of the question is Commands for Searching, Replacing and Substituting in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» Right choice is (a) / |
|
| 15. |
Which of the following symbols are used for searching a pattern in vi?(a) /(b) ?(c) %(d) / and ?I have been asked this question during a job interview.The doubt is from Commands for Searching, Replacing and Substituting in Vi Editor in chapter The Vi Editor of Unix |
|
Answer» The CORRECT option is (d) / and ? |
|
| 16. |
’10u’ command will reverse our 10 last editing actions.(a) True(b) FalseI have been asked this question in exam.I want to ask this question from Editing Text in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» Right CHOICE is (a) True |
|
| 17. |
Which command is used to redo the changes made by the undo command?(a) ctrl-l(b) ctrl-r(c) ctrl-g(d) ctrl-fI have been asked this question in my homework.This intriguing question comes from Editing Text in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» CORRECT option is (b) ctrl-r The best EXPLANATION: We can USE the control KEY (ctrl-r) to redo the changes which are made by the undo command. |
|
| 18. |
Which command will be used to join 4 lines with the current line?(a) 5J(b) 4J(c) 6J(d) 4jI had been asked this question by my college director while I was bunking the class.This interesting question is from Editing Text in Vi Editor in portion The Vi Editor of Unix |
|
Answer» The correct choice is (a) 5J |
|
| 19. |
___ command allows us to undo a number of changes that have been made to a single line before moving away from that line.(a) u(b) U(c) dd(d) yyI have been asked this question during an online exam.Query is from Editing Text in Vi Editor topic in section The Vi Editor of Unix |
|
Answer» The correct option is (b) U |
|
| 20. |
Which of the following undo a most recent single editing change?(a) u(b) U(c) uu(d) yyI had been asked this question in an online interview.This intriguing question originated from Editing Text in Vi Editor topic in portion The Vi Editor of Unix |
|
Answer» CORRECT answer is (a) u To explain: To reverse the last change you made to the BUFFER press the ‘u’ key. This will restore the state of the buffer by undoing the most recent action TAKEN. |
|
| 21. |
Which command is used for joining lines?(a) J(b) j(c) yy(d) jnThe question was posed to me in an online quiz.Question is taken from Editing Text in Vi Editor in section The Vi Editor of Unix |
|
Answer» CORRECT choice is (a) J The best I can explain: To join current LINE with the line(s) FOLLOWING it, we can use join (J) command. It just pulls up the following line by terminating the NEW line character between the current line and following line. |
|
| 22. |
We can use ‘yy’ command for copy and paste operation.(a) True(b) FalseThe question was posed to me in class test.This key question is from Editing Text in Vi Editor topic in portion The Vi Editor of Unix |
|
Answer» Correct ANSWER is (a) True |
|
| 23. |
Which command is used for putting deleted lines or part of lines at a different location?(a) p and P(b) x(c) dd(d) yI have been asked this question in exam.My doubt is from Editing Text in Vi Editor in portion The Vi Editor of Unix |
|
Answer» The CORRECT choice is (a) P and P |
|
| 24. |
To copy 10 lines from the current cursor location, we can use _____(a) 10y(b) 10yy(c) yy10(d) 10xI had been asked this question during an online interview.Question is from Editing Text in Vi Editor in portion The Vi Editor of Unix |
|
Answer» The correct CHOICE is (b) 10yy |
|
| 25. |
Both ‘p’ and ‘P’ command puts text right/left or above/below on the basis of line deleted.(a) True(b) FalseThis question was posed to me during an interview for a job.The origin of the question is Editing Text in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» Correct answer is (a) True |
|
| 26. |
To copy (yank) lines in vi editor, we use ______ command.(a) dd(b) x(c) p(d) yyThis question was addressed to me in an international level competition.I want to ask this question from Editing Text in Vi Editor in division The Vi Editor of Unix |
|
Answer» The correct CHOICE is (d) yy |
|
| 27. |
Which of the following commands will be used to delete 6 lines from the current cursor location?(a) 6d(b) 6X(c) 6dd(d) 6xThis question was posed to me in my homework.My enquiry is from Editing Text in Vi Editor in division The Vi Editor of Unix |
|
Answer» RIGHT answer is (C) 6dd Best explanation: ‘dd’ command can be used with repeat factor to delete multiple LINES at a single TIME. 6dd will delete the current line and 5 lines below. |
|
| 28. |
Which of the following command is used to delete a single line?(a) dd(b) x(c) X(d) dI had been asked this question in homework.My question is taken from Editing Text in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» Correct ANSWER is (a) DD |
|
| 29. |
Which command is used for deleting the character on the left of the cursor?(a) x(b) X(c) dd(d) dThe question was posed to me in a job interview.I need to ask this question from Editing Text in Vi Editor in portion The Vi Editor of Unix |
|
Answer» Correct answer is (B) X |
|
| 30. |
Which command is used for deleting a single character?(a) d(b) dd(c) x(d) wThis question was posed to me in my homework.My doubt is from Editing Text in Vi Editor in chapter The Vi Editor of Unix |
|
Answer» The correct answer is (c) x |
|
| 31. |
Which key is used for deleting text?(a) d(b) y(c) k(d) fThis question was addressed to me during an interview.This intriguing question comes from Editing Text in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» Correct CHOICE is (a) d |
|
| 32. |
Copying is referred to as yanking in vi editor.(a) True(b) FalseThe question was asked during a job interview.My question is taken from Editing Text in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» Correct ANSWER is (a) True |
|
| 33. |
Which of the following commands of ex-mode is equivalent to ‘G’ command in command mode?(a) : .(b) : $(c) : %(d) :wI got this question in my homework.Origin of the question is Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» RIGHT answer is (b) : $ Best EXPLANATION: ex-mode offers equivalent commands for moving between lines. ‘G’ COMMAND moves the cursor to end of the FILE which can also be achieved USING ‘: $’ command in ex-mode. |
|
| 34. |
Which key is used for absolute movement?(a) f(b) G(c) M(d) ctrl-gThis question was addressed to me during a job interview.This question is from Navigation in Vi Editor in chapter The Vi Editor of Unix |
|
Answer» Right option is (c) M |
|
| 35. |
Which command is used to know the current line number?(a) ctrl-f(b) ctrl-b(c) ctrl-z(d) ctrl-gThe question was posed to me during an interview for a job.Enquiry is from Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» Right option is (d) ctrl-g |
|
| 36. |
To navigate 20 pages forward, we can use ______ command.(a) 20 ctrl-b(b) 20 ctrl-d(c) 20 ctrl-u(d) 20 ctrl-fI have been asked this question in a national level competition.I'd like to ask this question from Navigation in Vi Editor in division The Vi Editor of Unix |
|
Answer» Right OPTION is (d) 20 ctrl-f |
|
| 37. |
We can scroll halve page using control keys.(a) True(b) FalseI have been asked this question in an interview.I would like to ask this question from Navigation in Vi Editor in section The Vi Editor of Unix |
|
Answer» The CORRECT OPTION is (a) True |
|
| 38. |
Which of the following control keys will be used for scrolling one page forward?(a) ctrl-f(b) ctrl-b(c) ctrl-z(d) ctrl-vI had been asked this question during an interview.This key question is from Navigation in Vi Editor topic in portion The Vi Editor of Unix |
|
Answer» Correct answer is (a) ctrl-f |
|
| 39. |
Which of the following commands will move the cursor to the end of line number 30 if the current position of the cursor is line number 01?(a) 30$(b) 30|(c) 30b(d) 30%I have been asked this question in an online quiz.Asked question is from Navigation in Vi Editor in section The Vi Editor of Unix |
|
Answer» Correct answer is (a) 30$ |
|
| 40. |
____ command moves the cursor to the end of next line.(a) 0(b) |(c) %(d) $This question was posed to me in examination.Query is from Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» The correct CHOICE is (d) $ |
|
| 41. |
Which command is used for moving the cursor to the line extreme?(a) |, 0(b) &(c) %(d) LThe question was asked in an interview.My question is based upon Navigation in Vi Editor topic in section The Vi Editor of Unix |
|
Answer» RIGHT choice is (a) |, 0 Explanation: For moving the cursor to the beginning or end of the line we can USE line extreme navigation COMMANDS (0,| and $). ‘|’ or ‘0’ moves the cursor to the first CHARACTER of a line. |
|
| 42. |
Using ‘w’ command we can _____________(a) move back to the beginning of the word(b) move forward to the end of the word(c) move forward to the beginning of the word(d) move back to the end of the wordI have been asked this question in final exam.My question comes from Navigation in Vi Editor in portion The Vi Editor of Unix |
|
Answer» Correct choice is (c) MOVE forward to the beginning of the word |
|
| 43. |
We can prefix repeat factor with word navigation commands.(a) True(b) FalseThis question was posed to me in unit test.I'm obligated to ask this question of Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» The CORRECT option is (a) True |
|
| 44. |
Using ‘e’ commandwe can _____________(a) move back to the beginning of the word(b) move forward to the end of the word(c) move forward to the beginning of the word(d) move back to the end of the wordI got this question in an online quiz.Origin of the question is Navigation in Vi Editor topic in section The Vi Editor of Unix |
|
Answer» Correct answer is (b) move forward to the end of the word |
|
| 45. |
Using ‘b’ commandwe can _____________(a) move back to the beginning of the word(b) move forward to the end ofthe word(c) move forward to the beginning ofthe word(d) move back to the end ofthe wordThe question was posed to me in quiz.The question is from Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» Right answer is (a) move back to the BEGINNING of the word |
|
| 46. |
We can perform word navigation in vi editor.(a) True(b) FalseThis question was addressed to me in final exam.My doubt is from Navigation in Vi Editor topic in chapter The Vi Editor of Unix |
|
Answer» The correct option is (a) True |
|
| 47. |
Which one of the following command is invalid?(a) 20h(b) 5l(c) 4k(d) 3dThis question was addressed to me in unit test.The doubt is from Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» The correct answer is (d) 3D |
|
| 48. |
We can prefix the repeat factor with navigation keys (h, j, k and l).(a) True(b) FalseThis question was addressed to me in an interview for internship.Asked question is from Navigation in Vi Editor in section The Vi Editor of Unix |
|
Answer» Right choice is (a) True |
|
| 49. |
Which one of the following keys are used to moving cursor rightwards along a line?(a) k(b) h(c) l(d) jI got this question in an online quiz.Query is from Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» RIGHT choice is (c) l Easy explanation: For moving the CURSOR TOWARDS the right, we can use ‘l’ KEY. |
|
| 50. |
Which of the following keys is used to moving cursor leftwards along a line?(a) k(b) h(c) l(d) jThe question was posed to me in homework.I'm obligated to ask this question of Navigation in Vi Editor topic in division The Vi Editor of Unix |
|
Answer» RIGHT answer is (b) h Best EXPLANATION: For moving the cursor TOWARDS left, we can use ‘h’ KEY. |
|