Back to the command reference

vi

EditorsFundamentals In real Linux

The classic editor, available almost everywhere

Name: vi = visual (as opposed to the line editor ex)

This command needs a real Linux system; you can practise it in real Linux mode.

Full man page

Description

vi is the classic full-screen Unix editor, present on practically every Unix-like system, even minimal servers and rescue environments. On most Linux distributions vi is really vim (or a small build of it).

Syntax

vi [FILE]...

Common options

i / EscInsert mode / normal mode
:wqSave and quit
:q!Quit without saving
x / dd / uDelete a character / a line / undo
/wordSearch for word (n for the next)

Examples

  • $ vi /etc/hosts

    Edit a file (vi is usually vim)

    Explain

Related