Vim package is one of open source text editor on terminal in Linux system, this tutorial will explain how to use this tool on your terminal.

Searching word :

/pattern       - Search a patten continuing from TOP position

?pattern       - Search a patten continuing from BOTTOM position

             - repeat  forward search (If press n)

             - repeat backward search (If press N)

Search and Replace:

If you need to Search and update a specific word or line for example would like to change the value to VALUE

echo"Enter the value"
read value
echo "Output is $value"
echo "no-output"

Open the file, press ESC, enter the below command,


or do you want to remove the line (echo "no-output")

:%s/echo "no-output"//g

Text Selection, Copy:

If you want to do the same thing in your file like collection of lines, cut, copy, format. First, need to select the text or lines. Leave from insert mode, enter the one of the below options then move up or down the cursor you can see few seclection lines.

v       - you can selects range of text

V       - you can selects entire lines on that page

ctrl-v  - you can selects columns on that page

gv      - reselect block

After selecting the text,

Use - To delete selected lines

Use y  - To copy selected lines

Use :s/match/replace/ - To match and replace the lines or :center, or !sort