Accessing Multiple Files

Command

Action

:e file

Edit another file; current file becomes alternate.

:e!

Return to version of current file at time of last write.

:e + file

Begin editing at end of file.

:e +num file

Open file at line num.

:e #

Open to previous position in alternate file.

:ta tag

Edit file at location tag.

:n

Edit next file in the list of files.

:n!

Force next file.

:n files

Specify new list of files.

:rewind

Edit first file in the list.

Ctrl-G

Show current file and line number.

:args

Display list of files to be edited.

:prev

Edit previous file in the list of files.

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.