Command-Line Syntax

The three most common ways of starting a vi session are:

vi [options] file
vi [options] +num file
vi [options] +/pattern file

You can open file for editing, optionally at line num or at the first line matching pattern. If no file is specified, vi opens with an empty buffer.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.