Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | N/A |
:q! ENTER
Let us see vi and vim commands in details.
How to quit the vi/vim editor without saving your changes
You can quit the vim or vi text editor without saving any changes you may have made to the file as follows:
- First, you need to press Esc key to get out of insert or append mode.
- Next type colon (: symbol)
- You see the cursor at the lower left corner of the screen.
- Finally, type the following command to quit without saving anything to a file:
q!
Getting more info on how to use vim text editor
The vim or vi text editor has three modes. It has many commands and options for both new and advanced users. I strongly suggest that you start learning vim by typing the following command at the terminal:
$ vimtutor
Vimtutor starts the Vim tutor. Very useful for people working in IT, sysadmin jobs, and developers that want to learn their first Vim commands. Many commands works with vi too.
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 4 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | 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 |
Thank you!
:wq
I believe that’s the opposite of “Vi / Vim: Quit Without Saving Command”
:q!