CMD Master
Back to Blog
Arnošt Havelka

Exit Terminal (exit)

Closing time.

Exit Terminal (exit)

When you're done being a hacker for the day, how do you leave? Clicking the 'X' works, but the pro way is to type exit. It's the polite way to say goodbye to the terminal.

Try the command

Run the command to close the terminal.

Build the command
exit
exitCodeSpecifies a numeric number (0 = success, non-zero = error).
Terminal
C:\Users\Student>exit
Exiting...

Real-World Examples

Close the terminal window:

Terminal
C:\Users\Student>exit

Exit a batch script with success code:

Terminal
C:\Users\Student>exit /B 0

Exit with error code (for scripting):

Terminal
C:\Users\Student>exit 1

Knowledge Check

1 / 2

What is the command to close the terminal?

References

These documentation links provide authoritative details for the commands used in this article.