Account
Categories

exit command


Definition:

If you are working in a Linux terminal in a current directory or a subdirectory and want to exit, you type the exit command.

Syntax:

exit

Explanation:

  • If you are working in a directory or any subdirectory, typing exit ends the terminal session.
  • The $ (normal-user) or # (root-user) symbol shows your current user in the terminal, but it disappears when you run the exit command and end the session.
  • Nothing in your files or folders changes; it only safely closes the session.

Example:

Command:

$ exit

Explanation:

  • After pressing Enter, the terminal closes, and you are out of the shell.