Starting the Erlang shell
On a UNIX system you start the Erlang shell from a command prompt with the command erl
Example:
$ erl
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.0 (abort with ^G)
1>
The text that shows when you start the shell tells you information about which version of Erlang you are running as well as other useful information about the erlang system.
To start the shell on Windows you click the Erlang-icon in the windows start menu.
Stopping the Erlang shell
For a controlled exit of the erlang shell you type:
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.0 (abort with ^G)
1> q().
You can also exit the Erlang shell by pressing Ctrl+C on UNIX systems or Ctrl+Break on Windows, which brings you to the following prompt:
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.0 (abort with ^G)
1>
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
If you then press a (for abort) you will exit the shell directly.
Other ways of exiting the erlang shell are: init:stop()
which does the same thing as q()
or erlang:halt()
.