Professional Documents
Culture Documents
19BCS2848 SWL-1.3
19BCS2848 SWL-1.3
19BCS2848 SWL-1.3
Tools/Software Required: Personal computer, Oracle virtual machine, Ubuntu ISO File.
Description: The objective of this experiment is to know how to create and edit files in VI
editor. In this experiment we will create a file and run various commands on this file using VI
editor.
Pseudo code/Algorithms/Flowchart/Steps:
Starting Vi Editor:- This editor can be invoked by typing vi filename at the prompt. If
you specify a filename as an argument to vi, then the vi will edit the specified file, if it
exists.
Vi<filename>
A status line at the bottom of the screen shows the filename, current line & character
position in the edited file.
Vi<line no><filename>
a) Insert Mode: -
(1) The text should be entered in this mode and any key pressed is created as text.
(2) We can enter in this mode through command mode by pressing any of the keysior
I.
b) Command Mode: -
(1) It is the default mode when we start up vi Editor.
c) Ex Mode: -
(1) The ex-mode command can be entered at the last line of the screen of the Mode.
(2) We can enter into this mode directly from input mode or vice-versa.
Implementation:
The following are some commands that are used:
(1). i: Insert before cursor.
(2). X: Delete the character before the cursor.
(3). Yy: Copies the current line.
(4). p: Puts the copied text after the cursor.
(5). o: Creates a new line for text entry below cursor location.
(6). r: Replace single character under the cursor with the next character typed.
Output: