VI is a command line editor

linux-penguinGetting to grips with the command line in Linux will mean that you'll always be able to manage practically any Linux distribution (and there are literally hundreds) without having to learn a new interface.

Command line instructions are often quicker to implement as well.


You can start using vi like this...

$ vi filename

vi has 2 modes, namely editing and viewing. You will start with the viewing mode. To start editing type i for insert or a to append. When you've finished type esc to toggle to the viewing mode. To enter a command whilst in the viewing mode type a colon followed by the command and press enter. Some basic vi commands include...

  • Cursor movement - h,j,k and l (left, down, up and right)
  • Delete character - x
  • Delete line - dd
  • Mode toggle - Esc, Insert (or i)
  • Quit - :q
  • Quit without saving - :q!
  • Run a shell command - :sh (use 'exit' to return)
  • Save a file - :w
  • Text search - /

 

Thanks for visiting.