To quit a shell session, enter the command exit.
exit
This ensures that commands the shell is actively running are closed. If anything’s still in progress, the shell warns you.