$linuxjunkies
>

nu(1)

Nushell is a modern shell and command language with structured data pipelines and a focus on usability.

UbuntuDebianFedoraArch

Synopsis

nu [OPTIONS] [FILE]

Description

Nushell (nu) is a cross-platform shell that treats data as structured objects rather than plain text streams. It combines the power of traditional Unix pipelines with a modern programming language, making it easier to work with JSON, CSV, databases, and other structured formats.

Unlike bash or zsh, Nushell uses a data-first approach where commands output tables and objects that can be filtered and transformed intuitively. It features strong typing, pattern matching, and a familiar syntax inspired by Python and Rust.

Common options

FlagWhat it does
-c, --commandRun a command string and exit (e.g., nu -c 'ls | length')
-n, --no-std-libStart without loading the standard library
-l, --loginStart as a login shell (load login configuration)
--stdinExecute a script passed via standard input
-e, --executeExecute the given script and exit
--no-config-fileStart without loading env.nu or config.nu
-v, --versionPrint version information and exit
-h, --helpPrint help message and exit

Examples

Start an interactive Nushell session

nu

List files showing only name and size columns (structured output)

nu -c 'ls | select name size'

Execute a Nushell script file

nu script.nu

Parse JSON, filter rows, and select specific columns

nu -c 'open data.json | where age > 30 | select name age'

Parse JSON from stdin and sort by a field

echo '[{name: Alice, score: 95}, {name: Bob, score: 87}]' | nu -c 'from json | sort-by score'

List processes with CPU usage greater than 50%

nu -c 'ps | where cpu > 50'

Execute a script piped via standard input

nu --stdin < myscript.nu

Display help for all available commands

nu -c 'help commands' | less

Related commands