Command Reference
To see all commands in Nushell, run help commands.
Command | Description |
---|---|
alias | Alias a command (with optional flags) to a new name |
all? | Test if every element of the input matches a predicate. |
ansi | Output ANSI codes to change color. |
ansi gradient | Draw text with a provided start and end code making a gradient |
ansi strip | Strip ANSI escape sequences from a string |
any? | Tests if any element of the input matches a predicate. |
append | Append any number of rows to a table. |
benchmark | Time the running time of a block |
build-string | Create a string from the arguments. |
cal | Display a calendar. |
cd | Change directory. |
char | Output special characters (e.g., ‘newline’). |
clear | Clear the terminal. |
collect | Collect the stream and pass it to a block. |
columns | Show the columns in the input. |
compact | Creates a table with non-empty rows. |
complete | Complete the external piped in, collecting outputs and exit code |
config | Edit nushell configuration files |
config env | Edit nu environment configurations |
config nu | Edit nu configurations |
cp | Copy files. |
dataframe | Deprecated command |
date | Date-related commands |
date format | Format a given date using a format string. |
date humanize | Print a ‘humanized’ format for the date, relative to now. |
date list-timezone | List supported time zones. |
date now | Get the current date. |
date to-record | Convert the date into a structured table. |
date to-table | Convert the date into a structured table. |
date to-timezone | Convert a date to a given time zone. |
db | Database commands |
db and | Includes an AND clause for a query or expression |
db as | Creates an alias for a column selection |
db col | Creates column expression for database |
db collect | Query a database using SQL. |
db describe | Describes connection and query of the DB object |
db fn | Creates function expression for a select operation |
db from | Select section from query statement for a DB |
db group-by | Group by query |
db join | Joins with another table or derived table. Default join type is inner |
db limit | Limit result from query |
db open | Open a database |
db or | Includes an OR clause for a query or expression |
db order-by | Orders by query |
db over | Adds a partition to an expression function |
db query | Query a database using SQL. |
db schema | Show database information, including its schema. |
db select | Creates a select statement for a DB |
db testing | Create query object |
db where | Includes a where statement for a query |
debug | Debug print the value(s) piped in. |
decode | Decode bytes as a string. |
def | Define a custom command |
def-env | Define a custom command, which participates in the caller environment |
default | Sets a default row’s column if missing. |
describe | Describe the value(s) piped in. |
detect columns | Attempt to automatically split text into multiple columns |
dfr | Dataframe commands |
dfr agg-groups | creates an agg_groups expression |
dfr aggregate | Performs a series of aggregations from a group by |
dfr all-false | Returns true if all values are false |
dfr all-true | Returns true if all values are true |
dfr append | Appends a new dataframe |
dfr arg-max | Return index for max value in series |
dfr arg-min | Return index for min value in series |
dfr arg-sort | Returns indexes for a sorted series |
dfr arg-true | Returns indexes where values are true |
dfr arg-unique | Returns indexes for unique values |
dfr as | Creates an alias expression |
dfr as-date | Converts string to date. |
dfr as-datetime | Converts string to datetime. |
dfr cache | Caches operations in a new LazyFrame |
dfr col | Creates a named column expression |
dfr collect | Collect lazy dataframe into dataframe |
dfr column | Returns the selected column |
dfr concatenate | Concatenates strings with other array |
dfr contains | Checks if a pattern is contained in a string |
dfr count-null | Counts null values |
dfr count-unique | Counts unique values or creates a n-unique expression |
dfr cumulative | Cumulative calculation for a series |
dfr describe | Describes dataframes numeric columns |
dfr drop | Creates a new dataframe by dropping the selected columns |
dfr drop-duplicates | Drops duplicate values in dataframe |
dfr drop-nulls | Drops null values in dataframe |
dfr dtypes | Show dataframe data types |
dfr explode | creates an explode expression |
dfr fetch | collects the lazyframe to the selected rows |
dfr fill-na | Replaces NA values with the given expression |
dfr fill-null | Replaces NULL values with the given expression |
dfr filter-with | Filters dataframe using a mask or expression as reference |
dfr first | Creates new dataframe with first rows or creates a first expression |
dfr flatten | creates a flatten expression |
dfr get | Creates dataframe with the selected columns |
dfr get-day | Gets day from date |
dfr get-hour | Gets hour from date |
dfr get-minute | Gets minute from date |
dfr get-month | Gets month from date |
dfr get-nanosecond | Gets nanosecond from date |
dfr get-ordinal | Gets ordinal from date |
dfr get-second | Gets second from date |
dfr get-week | Gets week from date |
dfr get-weekday | Gets weekday from date |
dfr get-year | Gets year from date |
dfr group-by | Creates a groupby object that can be used for other aggregations |
dfr is-duplicated | Creates mask indicating duplicated values |
dfr is-in | Checks if elements from a series are contained in right series |
dfr is-not-null | Creates mask where value is not null or creates a is-not-null expression |
dfr is-null | Creates mask where value is null or creates a is-null expression |
dfr is-unique | Creates mask indicating unique values |
dfr join | Joins a lazy frame with other lazy frame |
dfr last | Creates new dataframe with tail rows or creates a last expression |
dfr list | Aggregates a group to a Series |
dfr lit | Creates a literal expression |
dfr ls | Lists stored dataframes |
dfr max | Aggregates columns to their max value or creates a max expression |
dfr mean | Aggregates columns to their mean value or creates a mean expression |
dfr median | Aggregates columns to their median value or creates a median expression |
dfr melt | Unpivot a DataFrame from wide to long format |
dfr min | Aggregates columns to their min value or creates a min expression |
dfr not | Inverts boolean mask or creates a not expression |
dfr open | Opens csv, json or parquet file to create dataframe |
dfr pivot | Performs a pivot operation on a groupby object |
dfr quantile | Aggregates the columns to the selected quantile |
dfr rename | Renames a series |
dfr rename-col | Rename a dataframe column |
dfr replace | Replace the leftmost (sub)string by a regex pattern |
dfr replace-all | Replace all (sub)strings by a regex pattern |
dfr reverse | Reverses the LazyFrame |
dfr rolling | Rolling calculation for a series |
dfr sample | Create sample dataframe |
dfr select | Selects columns from lazyframe |
dfr set | Sets value where given mask is true |
dfr set-with-idx | Sets value in the given index |
dfr shape | Shows column and row size for a dataframe |
dfr shift | Shifts the values by a given period |
dfr slice | Creates new dataframe from a slice of rows |
dfr sort | Creates new sorted dataframe or series |
dfr sort-by | sorts a lazy dataframe based on expression(s) |
dfr std | Aggregates columns to their std value |
dfr str-lengths | Get lengths of all strings |
dfr str-slice | Slices the string from the start position until the selected length |
dfr strftime | Formats date based on string rule |
dfr sum | Aggregates columns to their sum value or creates a sum expression |
dfr take | Creates new dataframe using the given indices |
dfr to-csv | Saves dataframe to csv file |
dfr to-df | Converts a List, Table or Dictionary into a dataframe |
dfr to-dummies | Creates a new dataframe with dummy variables |
dfr to-lazy | Converts a dataframe into a lazy dataframe |
dfr to-lowercase | Lowercase the strings in the column |
dfr to-nu | Convert expression to a nu value for access and exploration |
dfr to-parquet | Saves dataframe to parquet file |
dfr to-uppercase | Uppercase the strings in the column |
dfr unique | Returns unique values from a series |
dfr value-counts | Returns a dataframe with the counts for unique values in series |
dfr var | Aggregates columns to their var value |
dfr when | Creates a when expression |
dfr with-column | Adds a series to the dataframe |
do | Run a block |
drop | Remove the last number of rows or columns. |
drop column | Remove the last number of columns. If you want to remove columns by name, try ‘reject’. |
drop nth | Drop the selected rows. |
du | Find disk usage sizes of specified items. |
each | Run a block on each element of input |
echo | Echo the arguments back to the user. |
empty? | Check for empty values. |
enter | Enters a new shell at the given path. |
env | Display current environment variables |
error make | Create an error. |
every | Show (or skip) every n-th row, starting from the first one. |
exec | Execute a command, replacing the current process. |
exit | Exit a Nu shell or exit Nu entirely. |
export | Export custom commands or environment variables from a module. |
export alias | Define an alias and export it from a module |
export def | Define a custom command and export it from a module |
export def-env | Define a custom command that participates in the environment and export it from a module |
export env | Export a block from a module that will be evaluated as an environment variable when imported. |
export extern | Define an extern and export it from a module |
extern | Define a signature for an external command |
fetch | Fetch the contents from a URL. |
find | Searches terms in the input or for elements of the input that satisfies the predicate. |
first | Show only the first number of rows. |
flatten | Flatten the table. |
fmt | Format a number |
for | Loop over a range |
format | Format columns into a string using a simple pattern. |
format filesize | Converts a column of filesizes to some specified format |
from | Parse a string or binary data into structured data |
from csv | Parse text as .csv and create table. |
from eml | Parse text as .eml and create table. |
from ics | Parse text as .ics and create table. |
from ini | Parse text as .ini and create table |
from json | Convert from json to structured data |
from nuon | Convert from nuon to structured data |
from ods | Parse OpenDocument Spreadsheet(.ods) data and create table. |
from ssv | Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2. |
from toml | Parse text as .toml and create table. |
from tsv | Parse text as .tsv and create table. |
from url | Parse url-encoded string as a table. |
from vcf | Parse text as .vcf and create table. |
from xlsx | Parse binary Excel(.xlsx) data and create table. |
from xml | Parse text as .xml and create table. |
from yaml | Parse text as .yaml/.yml and create table. |
from yml | Parse text as .yaml/.yml and create table. |
g | Switch to a given shell. |
get | Extract data using a cell path. |
glob | Creates a list of files and/or folders based on the glob pattern provided. |
grid | Renders the output to a textual terminal grid. |
group | Groups input into groups of group_size . |
group-by | Create a new table grouped. |
gstat | Get the git status of a repo |
hash | Apply hash function. |
hash base64 | base64 encode or decode a value |
hash md5 | Hash a value using the md5 hash algorithm |
hash sha256 | Hash a value using the sha256 hash algorithm |
headers | Use the first row of the table as column names. |
help | Display help information about commands. |
hide | Hide symbols in the current scope |
histogram | Creates a new table with a histogram based on the column name passed in. |
history | Get the command history |
if | Conditionally run a block. |
ignore | Ignore the output of the previous command in the pipeline |
inc | Increment a value or version. Optionally use the column of a table. |
input | Get input from the user. |
insert | Insert a new column. |
into | Commands to convert data from one type to another. |
into binary | Convert value to a binary primitive |
into bool | Convert value to boolean |
into datetime | Convert text into a datetime |
into decimal | Convert text into a decimal |
into duration | Convert value to duration |
into filesize | Convert value to filesize |
into int | Convert value to integer |
into string | Convert value to string |
keep | Deprecated command |
keep until | Deprecated command |
keep while | Deprecated command |
keybindings | Keybindings related commands |
keybindings default | List default keybindings |
keybindings list | List available options that can be used to create keybindings |
keybindings listen | Get input from the user. |
kill | Kill a process using the process id. |
last | Show only the last number of rows. |
length | Count the number of elements in the input. |
let | Create a variable and give it a value. |
let-env | Create an environment variable and give it a value. |
lines | Converts input to lines |
load-env | Loads an environment update from a record. |
ls | List the files in a directory. |
match | Deprecated command |
math | Use mathematical functions as aggregate functions on a list of numbers or tables. |
math abs | Returns absolute values of a list of numbers |
math avg | Finds the average of a list of numbers or tables |
math ceil | Applies the ceil function to a list of numbers |
math eval | Evaluate a math expression into a number |
math floor | Applies the floor function to a list of numbers |
math max | Finds the maximum within a list of numbers or tables |
math median | Gets the median of a list of numbers |
math min | Finds the minimum within a list of numbers or tables |
math mode | Gets the most frequent element(s) from a list of numbers or tables |
math product | Finds the product of a list of numbers or tables |
math round | Applies the round function to a list of numbers |
math sqrt | Applies the square root function to a list of numbers |
math stddev | Finds the stddev of a list of numbers or tables |
math sum | Finds the sum of a list of numbers or tables |
math variance | Finds the variance of a list of numbers or tables |
merge | Merge a table into an input table |
metadata | Get the metadata for items in the stream |
mkdir | Make directories, creates intermediary directories as required. |
module | Define a custom module |
move | Move columns before or after other columns |
mv | Move files or directories. |
n | Switch to the next shell. |
nth | Deprecated command |
nu-highlight | Syntax highlight the input string. |
open | Load a file into a cell, converting to table if possible (avoid by appending ‘—raw’). |
overlay | Commands for manipulating overlays. |
overlay add | Add definitions from a module as an overlay |
overlay list | List all active overlays |
overlay remove | Remove an active overlay |
p | Switch to the previous shell. |
par-each | Run a block on each element of input in parallel |
parse | Parse columns from string data using a simple pattern. |
path | Explore and manipulate paths. |
path basename | Get the final component of a path |
path dirname | Get the parent directory of a path |
path exists | Check whether a path exists |
path expand | Try to expand a path to its absolute form |
path join | Join a structured path or a list of path parts. |
path parse | Convert a path into structured data. |
path relative-to | Get a path as relative to another path. |
path split | Split a path into parts by a separator. |
path type | Get the type of the object a path refers to (e.g., file, dir, symlink) |
pivot | Deprecated command |
post | Post a body to a URL. |
prepend | Prepend any number of rows to a table. |
Prints the values given | |
ps | View information about system processes. |
query | Show all the query commands |
query json | execute json query on json file (open —raw <file> | query json ‘query string’) |
query web | execute selector query on html/web |
query xml | execute xpath query on xml |
random | Generate a random values. |
random bool | Generate a random boolean value |
random chars | Generate random chars |
random decimal | Generate a random decimal within a range [min..max] |
random dice | Generate a random dice roll |
random integer | Generate a random integer [min..max] |
random uuid | Generate a random uuid4 string |
range | Return only the selected rows. |
reduce | Aggregate a list table to a single value using an accumulator block. |
register | Register a plugin |
reject | Remove the given columns from the table. If you want to remove rows, try ‘drop’. |
rename | Creates a new table with columns renamed. |
reverse | Reverses the table. |
rm | Remove file(s). |
roll | Rolling commands for tables |
roll down | Roll table rows down |
roll left | Roll table columns left |
roll right | Roll table columns right |
roll up | Roll table rows up |
rotate | Rotates a table clockwise (default) or counter-clockwise (use —ccw flag). |
run-external | Runs external command |
save | Save a file. |
select | Down-select table to only these columns. |
seq | Print sequences of numbers. |
seq char | Print sequence of chars |
seq date | Print sequences of dates |
shells | Lists all open shells. |
shuffle | Shuffle rows randomly. |
size | Gather word count statistics on the text. |
skip | Skip the first n elements of the input. |
skip until | Skip elements of the input until a predicate is true. |
skip while | Skip elements of the input while a predicate is true. |
sleep | Delay for a specified amount of time. |
sort | Sort in increasing order. |
sort-by | Sort by the given columns, in increasing order. |
source | Runs a script file in the current context. |
split | Split contents across desired subcommand (like row, column) via the separator. |
split chars | Split a string’s characters into separate rows |
split column | Split a string into multiple columns using a separator |
split row | Split a string into multiple rows using a separator |
split-by | Create a new table splitted. |
str | Various commands for working with string data |
str camel-case | Convert a string to camelCase |
str capitalize | Capitalize first letter of text |
str collect | Concatenate multiple strings into a single string, with an optional separator between each |
str contains | Checks if string contains pattern |
str downcase | Make text lowercase |
str ends-with | Check if a string ends with a pattern |
str find-replace | Deprecated command |
str index-of | Returns start index of first occurrence of pattern in string, or -1 if no match |
str kebab-case | Convert a string to kebab-case |
str length | Output the length of any strings in the pipeline |
str lpad | Left-pad a string to a specific length |
str pascal-case | Convert a string to PascalCase |
str replace | Find and replace text |
str reverse | Reverse every string in the pipeline |
str rpad | Right-pad a string to a specific length |
str screaming-snake-case | Convert a string to SCREAMING_SNAKE_CASE |
str snake-case | Convert a string to snake_case |
str starts-with | Check if string starts with a pattern |
str substring | Get part of a string |
str title-case | Convert a string to Title Case |
str to-datetime | Deprecated command |
str to-decimal | Deprecated command |
str to-int | Deprecated command |
str trim | Trim whitespace or specific character |
str upcase | Make text uppercase |
sys | View information about the system. |
table | Render the table. |
take | Take the first n elements of the input. |
take until | Take elements of the input until a predicate is true. |
take while | Take elements of the input while a predicate is true. |
term size | Returns the terminal size |
to | Translate structured data to a format |
to csv | Convert table into .csv text |
to html | Convert table into simple HTML |
to json | Converts table data into JSON text. |
to md | Convert table into simple Markdown |
to nuon | Converts table data into Nuon (Nushell Object Notation) text. |
to text | Converts data into simple text. |
to toml | Convert table into .toml text |
to tsv | Convert table into .tsv text |
to url | Convert table into url-encoded text |
to xml | Convert table into .xml text |
to yaml | Convert table into .yaml/.yml text |
touch | Creates one or more files. |
transpose | Transposes the table contents so rows become columns and columns become rows. |
tutor | Run the tutorial. To begin, run: tutor |
unalias | Deprecated command |
uniq | Return the unique rows. |
update | Update an existing column to have a new value. |
update cells | Update the table cells. |
upsert | Update an existing column to have a new value, or insert a new column. |
url | Apply url function. |
url host | Get the host of a URL |
url path | Get the path of a URL |
url query | Get the query string of a URL |
url scheme | Get the scheme (e.g. http, file) of a URL |
use | Use definitions from a module |
version | Display Nu version. |
view-source | View a block, module, or a definition |
watch | Watch for file changes and execute Nu code when they happen. |
where | Filter values based on a condition. |
which | Finds a program file, alias or custom command. |
window | Creates a sliding window of window_size that slide by n rows/elements across input. |
with-env | Runs a block with an environment variable set. |
wrap | Wrap the value into a column. |
zip | Combine a stream with the input |