LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

erl

Erlang runtime system and interactive shell

TLDR

Start Erlang shell
$ erl
copy
Run with module
$ erl -s [module] [function]
copy
Run and halt
$ erl -noshell -s [module] [function] -s init stop
copy
Start named node
$ erl -name [node@host]
copy
Set cookie for distribution
$ erl -setcookie [secret]
copy
Load paths
$ erl -pa [ebin/]
copy
Evaluate expression
$ erl -eval "[io:format(\"Hello~n\")]"
copy

SYNOPSIS

erl [options]

DESCRIPTION

erl starts the Erlang runtime system and interactive shell. It's the primary way to run Erlang programs, either interactively or in batch mode.The shell provides an interactive environment for evaluating Erlang expressions. For production use, -noshell runs without the shell, and -s/-eval execute specific code.Erlang's distributed features are enabled through node naming (-name/-sname) and authentication (-setcookie).

PARAMETERS

-s MOD [FUNC [ARGS]]

Start module function.
-noshell
Run without interactive shell.
-name NAME
Long node name.
-sname NAME
Short node name.
-setcookie COOKIE
Distribution cookie.
-pa DIR
Prepend to code path.
-eval EXPR
Evaluate expression at startup.
-run MOD [FUNC [ARGS]]
Similar to -s but passes arguments as a list of strings.
-config FILE
Application configuration file (sys.config).
-detached
Start the Erlang runtime system detached from the controlling terminal.
-heart
Start a heartbeat monitoring process.
+P NUM
Set maximum number of concurrent processes (default 262144).
+K true|false
Enable or disable kernel poll (epoll/kqueue).

CONFIGURATION

sys.config

Application configuration file specifying runtime parameters for OTP applications.
vm.args
VM arguments file for distributed Erlang settings, memory limits, and node configuration.

CAVEATS

Shell differs from module syntax. Distribution requires matching cookies. Node names must be unique. Memory usage scales with processes.

HISTORY

Erlang was developed at Ericsson starting in 1986 by Joe Armstrong, Robert Virding, and Mike Williams for telecom systems. The erl command has been the standard way to run Erlang since its open-source release in 1998.

SEE ALSO

erlc(1), elixir(1)

Copied to clipboard
Kai