We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8
Sub: Computer Std.
:11th EC
Chapter: 7 Vim Editor & basic scripting
7.1 Working with Vim editor
Here students will understand different between single line command and script. What is meaning of script. 1. on CLI commands are written and executed at __? A one at a time B Multiple at a time c Both a and b d None 2. Shell scripts are commonly used by ___________ . A Operators B Programmers C Designer D Accountants 3. in earlier chapter we can execute multiple commands by using __ ? A Commands b Pipes c Prompt d None 4. who will execute all the commands available within the text file in a specified sequence. A Compiler b Shell c Interpreter d None 5. the file in which commands available in sequence is known as ? A Shell script b Java script c Shell d None 6. shell script can be defined as ___ A Text file b File c Series of commands d None 7. Computer programmers commonly use shell scripts for _______ . A Routine individual tasks B System administration C Both (a) and (b) D None of these 8. To execute a command, user types it on _____ prompt and press the enter key. A Command B Graphics C (a) or (b) D None of these 9. In Linux ,the output of the command is displayed on the ______ . A Editor B Graph C Screen D Shell script 10. Who will execute all the command available in the text file in a sequence ? A Source B Shell C Editor D User 11. All the command available in the text file in a sequence is called as ______ . A Shell writer B Shell editor C Shell script D Shell sequence 12. _______ can be defined as series of command written in a plain text file . A Shell editor B Shell writer C Shell sequence D Shell script 13. the shell script are commonly used by user to perform __ ? A Routine task b System administration c Both a and b d None 14. which command is used to create file ? A Cut b Paste c Cat d All of above 15. by using cat command we can not create __ ? A File b Append data c Shell script d None 16. to create shell script we can use ? A Browsers b Programmer c Text editor d Both a and b 17. which of the following are known as text editor ? A Pico b Vi c Vim d All of above 18. which of the following is graphical editor ? A Paint B Draw c Both a and b D Gedit 19. Gedit editor is available with ___ desktop ? A GNOME b KNOME C KDE d GDE 20. Which types of Graphical editor available to serve the purpose of writing shell scripts A Gedit B Kwriter C Both (a) & (b) D None of these 21. which of the following is graphical editor ? A Gedit B Kwrite C Both a and b D paint 22. which graphical editor is available with KDE desktop ? A Gedit b Kwrite c Both a and b d None 23. who has written the vim editor ? A Richard Stallman b Bill gates c Dennis m. ritchi d Bran Moolenarr 24. in which year the vim was released ? A 1990 b 1970 c 1979 d 1991 25. Into how many ways vim can be open ? A 1 B 2 C 3 D 4 26. It is a good option to start the vim editor by specifying a ……… . A Path name B File name C Drive name D Byte name 27. to open vi editor ,type …….. A Vi and press Enter key B Vi <filename> and press Enter C Vi <dir name> press Enter key D (a) or (b) 28. vi screen filled with ------------ sign on the left side of the screen . A ~ B # C | D $ 29. What is the name ~ sign ? A hash B Turtle C tilde D Tones 7.2 Vim modes – command mode Here students will get idea about how to start vi editor and start working it. 30. Which mode of VI editor allows the entry to commands to manipulate text? A insert mode B command mode C colon mode D ex mode 31. Command line displays____ A file name B total number of lines C columns in the file D all of these 32. VI editor works in ___ modes. A 2 B 3 C 4 D 5 33. Which mode of VI editor permits us to give commands at the command here? A Insert code B colon mode C ex mode D b and C 34. Which type of modes available in VI editor? A insert mode B command mode C colon mode or ex command mode D all of these 35. Which mode of VI editor permits us to give commands at the command here? A Insert code B colon mode C ex mode D b and C 36. Which type of modes available in VI editor? A insert mode B command mode C colon mode or ex command mode D all of these 37. By default, VI starts in the ___ mode. A insert B Colon C ex command D Command Insert Mode 38. which command are usually one or two character long, and entered with few keystrokes? A insert mode B command mode C colon mode D both a & b 39. to toggle between the command mode and the insert mode, press …… key . A Enter B Shift C Esc D Home key 40. Which mode permits us to give commands at the command line? A ex command mode B insert mode C colon mode D none of these 41. by using vi editor we can ___ ? A Insert b Append c Delete text d All of above 42. which key is used to give insert command ? A Ins b I c In d None 43. which key is used to give append command ? A A b I C In d None 44. which key is used to give open command ? A Ins b O C In d None 45. an extension to the command mode is ____ ? A Visual mode b Display mode c Both a and b d None 46. when we issue insert, append or open command, we will be in __ mode ? A Command mode b Insert mode c Execute mode d None 47. which mode is used to type text in file or navigate in file ? A Command mode b Insert mode C Execute mode d None 48. we can toggle between command and insert mode by using ___ key ? A Esc b Enter C Shift d All of above 49. Which command is used to append text at the end of the current position in VI editor? A a B A C I D O 50. Which command will be used to insert text after the current cursor position? A a B I C A D I 51. Which command will be used to insert text before the current cursor position? A A B I C a D I 52. Which command will be used to insert append text at the end of the current line? A a B I C A D I 53. Which command will be used to insert text from the beginning of a line? A A B I C a D I 54. Which command will be used to insert in a new line above the current cursor position? A r char B R C O D o 55. Which command will be used to insert in a new line below the current cursor position? A r char B R C O D O The Last Line Mode 56. what is the user of last line mode ? A Quitting the vim session b Saving a file C Both a and b d None 57. Command line displays____ A file name B total number of lines C columns in the file D all of these 58. to go into the last line mode we have to be in which mode ? A Insert mode b Command mode C Execute mode d None 59. which key is used to go to last line mode from command mode ? A ; b ! C : d None 60. the …mode normally is used for operations like quitting the Vim session or saving a file . A Command B Insert C Last line D None of these 7.3 Saving The File Here students will know how to save the file and run the file. 61. to save the file we have to switch to __ mode from insert mode ? A Command b Last line c Execute d Any mode 62. which key is used to switch to last line mode from insert mode ? A Esc b Enter c Shift d Ctrl 63. which of the following command is used to save the file ? A :wq b :qw c :q d None 64. if we type the :wq command at last line mode then what will happen ? A. the file will close without save B. the file will save and close and display the shell prompt C. both a and b D. none 65. What the use is of: we command in VI editor? A write and quit B wait and quit C write and quick D work and quit 66. Which command will be used to save file and remain in editing mode? A :w B :wq C :x D :q 67. Which command will be used to save file and quit editing mode? A :wr B :wy C :wq D :wp 68. Which command will be used to save file and quit editing mode? A :w B :x C :wq D :q 69. Which command will be used to quit editing mode without saving changes made in the file? A :x B :x! C :q D :q! 70. Which command will be used to save existing file with new nm end continue editing it under the new file name . A :x B :x! C :q D :saveas 71. if we open the Vim editor without typing file name then text will store in ___ ? A System buffer b Memory c Both a and b d No where 72. When vim editor is opened without typing file name, the text will be directly stored in the _ A System buffer (main memory ) B Local disk C Binary disk D None of these 73. what we have to do to transfer the data from buffer to the hard disk ? A Paste the data b Give the file name c Copy the data d Copy and paste the data Moving Around In The Document 74. which keys are used to move the cursor in up and down direction ? A Arrow keys B Mouse keys c Alphabet keys D All of above 75. Which command will be used to move cursor in up direction? A h B j C k D l 76. Which command will be used to move cursor in down direction? A j B k C l D h 77. Which command will be used to move cursor in left direction? A l B j C k D h 78. Which command will be used to move cursor in right direction? A j B k C l D H 79. Which command will move cursor right one space ? A Spacebar B K C L D H 80. Which command will be used to edit the document ? A Vi filename B :wq filename C :x file name D :x filename 81. A cursor needs to toggle between the command and the …mode while editing A Command mode B Last line mode C Insert mode D None of these 82. to edit the document we need to again open __ A vi command b nW command c Nb command d None 83. normally which character is used to enter the insert mode ? A G b B c I d H 84. which character will move the cursor at last line ? A G b I c H d B 85. in file if we had pressed the enter key before the saving the file ‘G’ place cursor in ___ A Last character b First character c New line after last line d Last line starting 86. in file if we had not pressed the enter key before the saving the file ‘G’ place cursor in ___ A Last character b First character of last line c New line after last line d Last line starting 87. once the editing is over press __ and give ___ command ? A ESC, Wq b Wq, Esc c Esc, :wq d None 88. which command is used to replace Gandhi with Gandhiji A :s/Gandhi/Gandhiji/g b s/Gandhi/Gandhiji/g c :%s/Gandhi/Gandhiji/g d None 89. which symbol represent that we want to replace string ? A :s b %s c : d . 7.4 Shell Script Here students can learn what is script and how to write it and execute it for result. 90. who allows to execute more than one command at a time ? A Shell script b Shell c Vi editor d All of above 91. All the command available in the text file in a sequence is called as ____ . A Shell writer B Shell editor C Shell script D Shell sequence 92. what is the extension of script file ? A .sc b .sh c .s d .hs 93. We can create the shell script using ………… . A Text editor B browser C Word processer D All of these 94. Shell scripts are written, when we want to carry out ___ tasks. A single B source C destination D repetitive 95. Shell scripts can also be useful in___ A modifying the working B Display output of commands C both a & b D none of these 96. The extension ……….. is basically used to specify that file is a shell script . A .script B .sh C .shell D None of these 97. The extension is ………… . A Mandatory B Not mandatory C (a) and (b) D None of these 98. Giving extension will help to differentiate between ……. Files and shell script file . A shell B Sh file C normal D All of these 99. it is compulsory to give the extension of script file ? A Yes b No c May be d Some times 7.5 Shell Script Variables Here students will understand about shell variables. 100. the process of shell scripting is similar to process of program in ___ A Lower language b Higher level language c Machine language d Assembly language 101. the most common feature of higher level language is __ A Prompts b Programming style c Variables d All of above 102. Variable like any other programming language are ….. part of shell script . A integral B External C Both D None of these 103. We can also display the value assigned to variable on the screen using …Command . A print B echo C statement D None of these 104. The value stored in the …….. can also be reused or change as per user need. A value B statement C variable D None of these 105. the entities wherein we can store or edit value is known as ? A Variables b Script c Command d All of above 106. which sign is used to assign the value to variable ? A =√ b + c * d $ 107. which sign is used to extract the value stored or assigned to variable ? A + b = c $ √ d None 108. the name of variable can consist of ? A Alphabets b Digits c Underscore (_) d All of above 109. first character of variable must be ? A Alphabet b Underscore c Both a and b d None 110. if the shell is unable to understand a word as a variable it interpret it as ? A Variable b Text c Linux command d Sentence User interaction and shell script 111. which command is also used to assign values to variable ? A Read b Get c Cat d cal 112. which command will accept the data from the standard input device ? A Read b Get c Cat d Cal 113. which command is used to accept the data from the user and to store value in variable ? A Get b Read c Cat d Cal 114. if we press the ENTER key without entering any character then it will assign ? A 0 b 1 c Null value d None 115. what is use of –n option with echo command ? A. it instruct the echo command to print data in next line B. it instruct the echo command to skip one line to print data C. it instruct the echo command not to print the new line after the display of message D. it instruct the echo command to skip one word to print data 116. if we had not used __ option with echo command then it will move the cursor to next line after printing the data A -b b -n c -g d -s 117. the values assign to variable can be of ? A Alphabets b Digit c Special character d All of above 7.6 Shell arithmetic Here students will know how to write script to interact with user. 118. which keyword is used for shell arithmetic ? A Expression b expr c Sum d None 119. expr means ……… A Expression B exposed C experiments D None of these 120. the contents written after expr are assumed to be __ and __ of an expression? A Commands, operations b Operands, operators c Operations, operators d Operands, commands 121. There should be … space between operator (+) and operands ($num1,$num2). A One B Two C Three D Four 122. how many space must be there between any operator in expr ? A 1 b 2 c 3 d Any number 123. which sign is used for modular operation in expression ? A - b / c % d None 124. Which command will be used to squeezed to single space ? A Tr - f B tr -s C Tr -a D Tr -q 125. the expression are evaluated as per __? A Standard methods b Specific norms of mathematics c General norms of mathematics d Methods given by user 126. in case of tie between operators of same priority preference will give to ? A Any operator b Operator which occurs last c Give error d Operator which occurs first 127. in expression $a\*\($b + $c \) / $d, which operation will be fist evaluated ? A $a * $b b $c / $d c $b + $c d $a / $d 128. The shell script is a very ……… tool of linux . A powerful B meaningful C (s) and (b) D None of these 129. Repetitive task should be done using the ………. . A programming B Shell script C Machine language D All of these 130. The uses of shell script are - A Create a new command using B Automating many aspects of multiple set of commands computer maintenance C Data backup D All of these