LinuxCommandLibrary

elixir

Functional language runtime on Erlang VM

TLDR

Run Elixir script

$ elixir [script.exs]
copy
Evaluate expression
$ elixir -e "[IO.puts \"Hello\"]"
copy
Start with shell
$ elixir -S iex
copy
Run with Mix project
$ elixir -S mix run
copy
Start named node
$ elixir --name [node@host] -S iex
copy
Set environment
$ MIX_ENV=prod elixir -S mix phx.server
copy

SYNOPSIS

elixir [options] [script] [args]

DESCRIPTION

elixir runs Elixir code and scripts. It's the primary command for executing Elixir programs, supporting both script files (.exs) and compiled modules.
The command starts the Erlang VM with Elixir loaded. Options control distributed computing settings, code loading, and execution mode. Combined with `-S mix`, it runs Mix tasks.
Elixir's interactive shell (IEx) can be started using `elixir -S iex` for development and debugging.

PARAMETERS

SCRIPT

Elixir script file to run.
-e CODE
Evaluate code string.
-r FILE
Require file before execution.
-S SCRIPT
Run Erlang/Elixir script.
--name NAME
Set distributed node name.
--sname NAME
Set short node name.
--cookie COOKIE
Set Erlang distribution cookie.
--help
Display help information.

CAVEATS

Requires Erlang/OTP installed. Startup time includes BEAM VM boot. Scripts have .exs extension by convention. Distributed features need network configuration.

HISTORY

Elixir was created by José Valim and released in 2011, running on the Erlang BEAM VM. It brought modern syntax and tooling to the Erlang ecosystem while maintaining compatibility.

SEE ALSO

iex(1), mix(1), erl(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community