You can save a lot of time by using appropriate movement commands in vi or vim text editor. For large file the cursor keys are not the best choice. To move to end of file just type G (press ESC and type capital G):
Sample outputs (jumping from 1st line to line # 82):
You can jump back to beginning of file by typing any one of the following command
You can jump to line number 700 (press ESC type 700G)
Move cursor to end of file in vim
In short press the Esc key and then press Shift + G to move cursor to end of file in vi or vim text editor under Linux and Unix-like systems. However, you can use the following keyboard shortcuts too.
- Esc + Ctrl + End – Jump end of file
- Hit Esc + Ctrl + Home : Jump start of file
- Press Esc + gg : Go to top the file
- Esc + G : Go to bottom of the file
- Esc + G + A : Go to bottom of the file and in append text mode. In other words, jump to last line and start writing code/text.
- Hit Esc + A + $ : Go to bottom of the file and end of line.
In this quick tutorial, you learned how to move to the last character of the file. Now you know how to jump to the end of the file using the vim command. We also explained how to jump to the start of the file using the vim text editor, including various keyboard shortcuts combinations. If you have any problems or concerns, let us know in the comment section below.
🐧 12 comments so far... add one ↓
|Category||List of Unix and Linux commands|
|Disk space analyzers||df • ncdu • pydf|
|File Management||cat • tree|
|Firewall||Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04|
|Network Utilities||NetHogs • dig • host • ip • nmap|
|OpenVPN||CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04|
|Package Manager||apk • apt|
|Processes Management||bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time|
|Searching||grep • whereis • which|
|User Information||groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w|
|WireGuard VPN||Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04|