Skip to main content

Terminal Basics

Exit the Terminal

A beginners tip on exiting the terminal in Ubuntu Linux.

The easiest way to quit the terminal in Ubuntu is to use the exit command which will close the terminal:

exit
📋
You can not quit the terminal if there's an active ongoing process. You must kill the process first to get out of 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 exit command:

exit
quit the ubuntu terminal using the exit command

But if you have an active remote shell connection, you'll have to use the exit command multiple times:

use exit command multiple times if you have remote connection

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):

Use Ctrl + D to quit the terminal in Ubuntu
Used Ctrl + D two times to quit the terminal connected to the SSH session

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:

How to Install Zsh on Ubuntu and Customize it
Envy the beautiful Z shell? Learn how to install zsh on Ubuntu and customize it with Oh My Zash.

I hope you will find this guide helpful.