0% found this document useful (0 votes)
12 views3 pages

UnixLab Writeup Instr Exp04

The document outlines an experiment aimed at understanding the use of command line text editing tools vi, vim, and nano on Linux systems. It provides a detailed overview of the VI editor's modes, commands for navigation, editing, saving, exiting, and searching text. The procedure involves students practicing these commands on multiple files and documenting their steps.

Uploaded by

gp249780
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

UnixLab Writeup Instr Exp04

The document outlines an experiment aimed at understanding the use of command line text editing tools vi, vim, and nano on Linux systems. It provides a detailed overview of the VI editor's modes, commands for navigation, editing, saving, exiting, and searching text. The procedure involves students practicing these commands on multiple files and documenting their steps.

Uploaded by

gp249780
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Experiment Number 04

Aim: To Understand use of text editing command line tools namely vi, vim and nano.

Required Software: Any PC with Linux installation and Terminal Emulator or Console based
Command Line interface. vim and nano software installation.

Objective: We will learn use of different command line text editing software vi, vim and nano

Theory:

The VI editor is a powerful and widely used text editor in Unix and Linux systems.

It has two modes of operation:

1. command mode

2. insert mode.

Opening a File For Editing:

To open a file using VI, open a terminal and type: vi filename and press enter

Editor Modes:

1. Command Mode: This is the default mode for navigating and manipulating text.

2. Insert Mode: In this mode, you can actually insert and edit the text of the file.

Command Mode:

Commands for Navigation:

• h - Move cursor left

• j - Move cursor down

• k - Move cursor up

• l - Move cursor right

• 0 - Move to the beginning of the line

• $ - Move to the end of the line

• gg - Move to the beginning of the file


• G - Move to the end of the file

Commands for Editing:

• i - Switch to insert mode before the cursor

• I - Switch to insert mode at the beginning of the line

• a - Switch to insert mode after the cursor

• A - Switch to insert mode at the end of the line

• o - Open a new line below the current line and switch to insert mode

• O - Open a new line above the current line and switch to insert mode

• x - Delete the character under the cursor

• dd - Delete the current line

• yy - Yank (copy) the current line

• p - Paste the yanked/cut text after the cursor

• u – Undo previous command

• Ctrl-r – Redo undone command

Commands for Saving and Exiting Editor:

• :w - Save changes

• :q - Quit (exit)

• :wq - Save and quit

• :q! - Quit without saving (force quit)

Commands for Searching Text:

• /search_term - Search forward for "search_term"

• ?search_term - Search backward for "search_term"

• n - Move to the next occurrence

• N - Move to the previous occurrence


Switching back from Insert Mode:

Press `Esc` to switch back to command mode.

This is just a basic overview. VI has many more features and commands. Once you get used to it,
it becomes a very efficient text editor.

Procedure: Students will use the information above to practice editing on multiple files. As part
of Working in the write up they need to enlist all steps they followed in order to practice all steps
mentioned in the above Theory.

Conclusion:

We have learned how to use vim command line editor.

Resources:

1. Manual of vi editor.

2. Linux Lab - Open source Technology : Ambavade -Dreamtech

You might also like