Exit (command)

Termination command of many command-line interpreters and scripting languages
title: "Exit (command)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["ibm-i-qshell-commands", "internal-dos-commands", "msx-dos-commands", "os/2-commands", "reactos-commands", "unix-process--and-task-management-related-software", "unix-sus2008-utilities", "windows-administration"] description: "Termination command of many command-line interpreters and scripting languages" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Exit_(command)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Termination command of many command-line interpreters and scripting languages ::
::data[format=table title="Infobox software"]
| Field | Value |
|---|---|
| name | exit |
| screenshot | ReactOS-0.4.13 exit command 667x434.png |
| caption | The ReactOS exit command |
| developer | Various open-source and commercial developers |
| operating system | Cross-platform |
| genre | Command |
| :: |
| name = exit
| logo =
| screenshot = ReactOS-0.4.13 exit command 667x434.png
| screenshot size =
| caption = The ReactOS exit command
| developer = Various open-source and commercial developers
| released =
| latest release version =
| latest release date =
| operating system = Cross-platform
| genre = Command
| license =
| website =
In computing, exit is a command used in many operating system command-line shells and scripting languages.
The command causes the shell or program to terminate. If performed within an interactive command shell, the user is logged out of their current session, and/or user's current console or terminal connection is disconnected. Typically an optional exit code can be specified, which is typically a simple integer value that is then returned to the parent process.
Implementations
Operating systems, shells, and scripting languages providing this command include Microsoft MSX-DOS version 2, IBM OS/2, DR FlexOS, HP MPE/iX, KolibriOS, SymbOS, cmd.exe, sh, ksh, Perl, AWK, PHP, TCL, PowerShell, and others.
On MS-DOS, the command is available in versions 2 and later. DR DOS 6.0 and Datalight ROM-DOS also include an implementation of the command. It is also available in the open source MS-DOS emulator DOSBox.
The numerical computing environment MATLAB includes an exit function with similar functionality.
References
References
- [https://archive.org/details/MSXDOS2 MSX-DOS version 2]
- "JaTomes Help - OS/2 Commands".
- "User Guide".
- "MPE/iX Command Reference Manual".
- "Shell - KolibriOS wiki".
- "Data".
- Archiveddocs. "Exit3".
- (2003). "Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition". [[Microsoft Press]].
- [https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf DR DOS 6.0 User Guide Optimisation and Configuration Tips]
- "Datalight ROM-DOS User's Guide".
- "Terminate MATLAB program (Same as quit) - MATLAB exit".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::