$linuxjunkies
>

elvish(1)

Elvish is an expressive programming language and shell for Linux and other Unix-like systems.

UbuntuDebianFedoraArch

Synopsis

elvish [FLAG]... [FILE]...

Description

Elvish is a modern shell written in Go that combines the features of a traditional Unix shell with those of a programming language. It offers a more expressive syntax, better error handling, and structured data types including lists and maps, making it suitable for both interactive use and scripting.

When invoked without arguments, Elvish starts an interactive REPL. When given a script file, it executes the file. Elvish can also be used as a login shell or invoked with the -c flag to execute inline code.

Common options

FlagWhat it does
-c CODEExecute CODE as Elvish script and exit
-norcSkip loading the RC file (~/.config/elvish/rc.elv)
-deprecation-level LEVELSet deprecation warning level (0=silent, 1=soft, 2=hard); default is 2
-log-level LEVELSet logging level (debug, info, warn, error); default is warn
-log-file FILEWrite logs to FILE instead of stderr
-helpShow help message and exit
-versionShow version information and exit

Examples

Start the Elvish interactive shell

elvish

Execute the Elvish script file myscript.elv

elvish myscript.elv

Execute inline Elvish code that outputs the result of 2+3

elvish -c 'put (+ 2 3)'

Run a loop that iterates over a list and outputs each element

elvish -c 'for x [1 2 3] { put $x }'

Start Elvish without loading the RC configuration file

elvish -norc

Create a list and output it using Elvish's data structures

elvish -c 'set arr = [apple banana cherry]; echo $arr'

Related commands