LinuxCommandLibrary

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.
-config FILE
Configuration file.

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), rebar3(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community