Modes
vi uses command mode for operations and insert mode for typing text.
Linux · VI Editor
Linux · Lesson
Master vi editor for configuration editing. Search, replace and navigation tips. Editing system files safely. Must have skill for Unix admins.
On almost every Unix, Linux and Solaris system, the vi editor is guaranteed to be available.
Even if administrators prefer other editors, vi remains essential because it is commonly used on remote servers, rescue systems and minimal installations.
This lesson focuses on the most commonly used vi operations for system administrators including navigation, editing, searching and safe configuration file management.
vi uses command mode for operations and insert mode for typing text.
Changes are stored in memory until you save them using :w or :wq.
Quickly search and modify configuration files without using a mouse.
Always create backup copies before editing critical system configuration files.
Use tools like diff to confirm exactly what changed after editing.
The following examples demonstrate common vi editor workflows used by Linux and Solaris administrators.
Use :q! to exit without saving changes when you make a mistake.
Enter insert mode, type text, then save and quit safely.
Use navigation shortcuts and pattern searching to edit configuration files quickly.
Always create a backup before modifying important system configuration files.
Use undo, yank and paste commands while editing files.
vi filename.:wq and exit without saving using :q!./pattern.diff to compare original and modified files.Once you become comfortable with vi, editing ZFS, SMF, SSH and network configuration files becomes much easier for system administration tasks.