This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Exit

Exit[]
terminates a Mathematica kernel session.
  • Exit terminates the kernel session even if called from within Dialog.
  • On most computer systems, Exit[n] can be used to pass the integer exit code n to the operating system.
Exit terminates the kernel, losing any definitions that have been made:
In[1]:=
Click for copyable input
Out[1]=
Exit[] will terminate the kernel. Do not enter it if you have any definitions you want to keep:
In[2]:=
Click for copyable input
The previous definition for a has been lost:
In[3]:=
Click for copyable input
Out[3]=
New in 1