Move or jump to specific lines in vi

Contributor Icon Contributed by Rex Date Icon February 16, 2004  
Tag Icon Tagged: UNIX

Navigating large files is an important capability when using any editor. The vi editor makes it easy to move around.


All of the following commands must be entered in command mode, not insert mode. Pressing ESC will ensure you are in command mode.

To jump to the end (last line) of a document:

G

To move to the first line of a document:

0G

This is a special case of the more general command to move to any specific line. To jump to the 3872nd line:

3872G

Previous recipe | Next recipe |
 

Viewing 1 Comment

 
close Reblog this comment
blog comments powered by Disqus