To jump to the end of a file in vi
or vim
, you can use the G
command.
In normal mode, press Shift + G
to jump to the last line of the file.
Alternatively, you can type :$
in command mode to jump to the end of the file.
For example, to open a file called myfile.txt
and jump to the end of the file, you can type the following command:
vi + myfile.txt
This will open the myfile.txt
file and automatically jump to the last line of the file.
Note: In vi
and vim
, G
stands for "go". The G
command can also be used to jump to a specific line in the file. For example, to jump to line 100, you can type 100G
.