← 返回命令列表

Linux command

iex 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start interactive Elixir

iex

Start with project

iex -S mix

Evaluate expression

iex -e "IO.puts(:hello)"

Connect to node

iex --remsh [node@host]

Start with name

iex --sname [mynode]

Load file

iex [script.exs]

说明

iex is the Interactive Elixir shell. It provides a REPL for evaluating Elixir expressions and exploring code. The shell supports tab completion, history, and documentation lookup. It integrates with Mix projects and remote nodes.

参数

-S _SCRIPT_
Run script (e.g., mix).
-e _EXPR_
Evaluate expression.
--remsh _NODE_
Remote shell to node.
--sname _NAME_
Short node name.
--name _NAME_
Full node name.
--help
Display help information.

FAQ

What is the iex command used for?

iex is the Interactive Elixir shell. It provides a REPL for evaluating Elixir expressions and exploring code. The shell supports tab completion, history, and documentation lookup. It integrates with Mix projects and remote nodes.

How do I run a basic iex example?

Run `iex` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -S _SCRIPT_ do in iex?

Run script (e.g., mix).