The easiest way to quit the terminal in Ubuntu is to use the exit command which will close the terminal:
But if you have an active SSH connection, using the
exit command will close the connection and hand over a local system to you.
There's one shortcut too that is equivalent to using the exit command which I will be discussing in the later part of this tutorial.
Quit the terminal using the exit command
If you wish to quit the terminal using a command then you can easily rely on the exit command which will quit the terminal in a moment.
All you have to do is execute the
But if you have an active remote shell connection, you'll have to use the exit command multiple times:
Yes, it's that simple!
Quit the terminal using a shortcut in Ubuntu
If you are someone who prefers using shortcuts, then you can use
Ctrl + D to quit the terminal and have the same effect as executing the exit command.
For example, here, I used the
Ctrl + D shortcut to quit the terminal when I was logged in via SSH (used shortcut two times):
Pretty easy. Right?
Make your Ubuntu terminal look modern
While working on personal projects, I use ZSH as I can use plugins and themes which eventually make it look modern and more efficient.
For Learnubuntu's readers, we wrote a simple yet effective guide that will help you get started with the installation and customization of ZSH:
I hope you will find this guide helpful.