nushell / latest

Command Reference

If you're new to Nushell, the quick tour can show you the most important commands. You don't need to know them all!

To see all commands from inside Nushell, run help commands.

Command Categories Description
alias core Alias a command (with optional flags) to a new name.
all filters Test if every element of the input fulfills a predicate expression.
ansi platform Output ANSI codes to change color and style of text.
ansi gradient platform Add a color gradient (using ANSI color codes) to the given string.
ansi link platform Add a link (using OSC 8 escape sequence) to the given string.
ansi strip platform Strip ANSI escape sequences from a string.
any filters Tests if any element of the input fulfills a predicate expression.
append filters Append any number of rows to a table.
ast debug Print the abstract syntax tree (ast) for a pipeline.
bits bits Various commands for working with bits.
bits and bits Performs bitwise and for integers.
bits not bits Performs logical negation on each bit.
bits or bits Performs bitwise or for integers.
bits rol bits Bitwise rotate left for integers.
bits ror bits Bitwise rotate right for integers.
bits shl bits Bitwise shift left for integers.
bits shr bits Bitwise shift right for integers.
bits xor bits Performs bitwise xor for integers.
break core Break a loop.
bytes bytes Various commands for working with byte data.
bytes add bytes Add specified bytes to the input.
bytes at bytes Get bytes defined by a range
bytes build bytes Create bytes from the arguments.
bytes collect bytes Concatenate multiple binary into a single binary, with an optional separator between each.
bytes ends-with bytes Check if bytes ends with a pattern.
bytes index-of bytes Returns start index of first occurrence of pattern in bytes, or -1 if no match.
bytes length bytes Output the length of any bytes in the pipeline.
bytes remove bytes Remove bytes.
bytes replace bytes Find and replace binary.
bytes reverse bytes Reverse the bytes in the pipeline.
bytes starts-with bytes Check if bytes starts with a pattern.
cal generators Display a calendar.
cd filesystem Change directory.
char strings Output special characters (e.g., 'newline').
clear platform Clear the terminal.
collect filters Collect the stream and pass it to a block.
columns filters Given a record or table, produce a list of its columns' names.
commandline core View or modify the current command line input buffer.
compact filters Creates a table with non-empty rows.
complete system Capture the outputs and exit code from an external piped in command in a nushell table.
config env Edit nushell configuration files.
config env env Edit nu environment configurations.
config nu env Edit nu configurations.
config reset env Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu.
const core Create a parse-time constant.
continue core Continue a loop from the next iteration.
cp filesystem Copy files.
date date Date-related commands.
date format removed Removed command: use `format date` instead
date humanize date Print a 'humanized' format for the date, relative to now.
date list-timezone date List supported time zones.
date now date Get the current date.
date to-record date Convert the date into a record.
date to-table date Convert the date into a structured table.
date to-timezone date Convert a date to a given time zone.
debug debug Debug print the value(s) piped in.
decode strings Decode bytes into a string.
decode base64 hash Base64 decode a value.
decode hex formats Hex decode a value.
def core Define a custom command.
def-env core Define a custom command, which participates in the caller environment.
default filters Sets a default row's column if missing.
describe core Describe the type and structure of the value(s) piped in.
detect columns strings Attempt to automatically split text into multiple columns.
dfr agg lazyframe Performs a series of aggregations from a group-by.
dfr agg-groups expression creates an agg_groups expression
dfr all-false dataframe Returns true if all values are false.
dfr all-true dataframe Returns true if all values are true.
dfr append dataframe Appends a new dataframe.
dfr arg-max dataframe Return index for max value in series.
dfr arg-min dataframe Return index for min value in series.
dfr arg-sort dataframe Returns indexes for a sorted series.
dfr arg-true dataframe Returns indexes where values are true.
dfr arg-unique dataframe Returns indexes for unique values.
dfr arg-where expression Creates an expression that returns the arguments where expression is true.
dfr as expression Creates an alias expression.
dfr as-date dataframe Converts string to date.
dfr as-datetime dataframe Converts string to datetime.
dfr cache lazyframe Caches operations in a new LazyFrame
dfr col expression Creates a named column expression.
dfr collect lazyframe Collect lazy dataframe into eager dataframe.
dfr columns dataframe Show dataframe columns.
dfr concat-str expression Creates a concat string expression.
dfr concatenate dataframe Concatenates strings with other array.
dfr contains dataframe Checks if a pattern is contained in a string.
dfr count expression creates a count expression
dfr count-null dataframe Counts null values.
dfr cumulative dataframe Cumulative calculation for a series.
dfr datepart expression Creates an expression for capturing the specified datepart in a column.
dfr drop dataframe Creates a new dataframe by dropping the selected columns.
dfr drop-duplicates dataframe Drops duplicate values in dataframe.
dfr drop-nulls dataframe Drops null values in dataframe.
dfr dtypes dataframe Show dataframe data types.
dfr dummies dataframe Creates a new dataframe with dummy variables.
dfr explode lazyframe Explodes a dataframe or creates a explode expression.
dfr expr-not expression creates a not expression
dfr fetch lazyframe collects the lazyframe to the selected rows.
dfr fill-nan lazyframe Replaces NaN values with the given expression.
dfr fill-null lazyframe Replaces NULL values with the given expression.
dfr filter lazyframe Filter dataframe based in expression.
dfr filter-with dataframe or lazyframe Filters dataframe using a mask or expression as reference.
dfr first dataframe Show only the first number of rows or create a first expression
dfr flatten lazyframe An alias for dfr explode
dfr get dataframe Creates dataframe with the selected columns.
dfr get-day dataframe Gets day from date.
dfr get-hour dataframe Gets hour from date.
dfr get-minute dataframe Gets minute from date.
dfr get-month dataframe Gets month from date.
dfr get-nanosecond dataframe Gets nanosecond from date.
dfr get-ordinal dataframe Gets ordinal from date.
dfr get-second dataframe Gets second from date.
dfr get-week dataframe Gets week from date.
dfr get-weekday dataframe Gets weekday from date.
dfr get-year dataframe Gets year from date.
dfr group-by lazyframe Creates a group-by object that can be used for other aggregations.
dfr implode expression Aggregates a group to a Series
dfr into-df dataframe Converts a list, table or record into a dataframe.
dfr into-lazy lazyframe Converts a dataframe into a lazy dataframe.
dfr into-nu dataframe Converts a dataframe or an expression into into nushell value for access and exploration.
dfr is-duplicated dataframe Creates mask indicating duplicated values.
dfr is-in expression Creates an is-in expression.
dfr is-not-null dataframe Creates mask where value is not null.
dfr is-null dataframe Creates mask where value is null.
dfr is-unique dataframe Creates mask indicating unique values.
dfr join lazyframe Joins a lazy frame with other lazy frame.
dfr last dataframe Creates new dataframe with tail rows or creates a last expression.
dfr lit expression Creates a literal expression.
dfr lowercase dataframe Lowercase the strings in the column.
dfr ls dataframe Lists stored dataframes.
dfr max expression Creates a max expression or aggregates columns to their max value
dfr mean expression Creates a mean expression for an aggregation or aggregates columns to their mean value
dfr median lazyframe Aggregates columns to their median value
dfr melt dataframe Unpivot a DataFrame from wide to long format.
dfr min expression Creates a min expression or aggregates columns to their min value
dfr n-unique dataframe Counts unique values.
dfr not dataframe Inverts boolean mask.
dfr open dataframe Opens CSV, JSON, JSON lines, arrow, avro, or parquet file to create dataframe.
dfr otherwise expression completes a when expression.
dfr quantile lazyframe Aggregates the columns to the selected quantile.
dfr query dataframe Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause.
dfr rename dataframe or lazyframe Rename a dataframe column.
dfr replace dataframe Replace the leftmost (sub)string by a regex pattern.
dfr replace-all dataframe Replace all (sub)strings by a regex pattern.
dfr reverse lazyframe Reverses the LazyFrame
dfr rolling dataframe Rolling calculation for a series.
dfr sample dataframe Create sample dataframe.
dfr select lazyframe Selects columns from lazyframe.
dfr set dataframe Sets value where given mask is true.
dfr set-with-idx dataframe Sets value in the given index.
dfr shape dataframe Shows column and row size for a dataframe.
dfr shift dataframe or lazyframe Shifts the values by a given period.
dfr slice dataframe Creates new dataframe from a slice of rows.
dfr sort-by lazyframe sorts a lazy dataframe based on expression(s).
dfr std expression Creates a std expression for an aggregation of std value from columns in a dataframe
dfr str-lengths dataframe Get lengths of all strings.
dfr str-slice dataframe Slices the string from the start position until the selected length.
dfr strftime dataframe Formats date based on string rule.
dfr sum expression Creates a sum expression for an aggregation or aggregates columns to their sum value
dfr summary dataframe For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns.
dfr take dataframe Creates new dataframe using the given indices.
dfr to-arrow dataframe Saves dataframe to arrow file.
dfr to-avro dataframe Saves dataframe to avro file.
dfr to-csv dataframe Saves dataframe to CSV file.
dfr to-jsonl dataframe Saves dataframe to a JSON lines file.
dfr to-parquet dataframe Saves dataframe to parquet file.
dfr unique dataframe or lazyframe Returns unique values from a dataframe.
dfr uppercase dataframe Uppercase the strings in the column.
dfr value-counts dataframe Returns a dataframe with the counts for unique values in series.
dfr var expression Create a var expression for an aggregation
dfr when expression Creates and modifies a when expression.
dfr with-column dataframe or lazyframe Adds a series to the dataframe.
do core Run a closure, providing it with the pipeline input.
drop filters Remove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`.
drop column filters Remove N columns at the right-hand end of the input table. To remove columns by name, use `reject`.
drop nth filters Drop the selected rows.
du core Find disk usage sizes of specified items.
each filters Run a closure on each row of the input list, creating a new list with the results.
each while filters Run a block on each row of the input list until a null is found, then create a new list with the results.
echo core Returns its arguments, ignoring the piped-in value.
encode strings Encode a string into bytes.
encode base64 hash Encode a string or binary value using Base64.
encode hex formats Encode a binary value using hex.
enter shells Enters a new shell at the given path.
enumerate filters Enumerate the elements in a stream.
error make core Create an error.
every filters Show (or skip) every n-th row, starting from the first one.
exec system Execute a command, replacing the current process.
exit shells Exit Nu.
explain debug Explain closure contents.
explore viewers Explore acts as a table pager, just like `less` does for text.
export core Export definitions or environment variables from a module.
export alias core Alias a command (with optional flags) to a new name and export it from a module.
export const core Use parse-time constant from a module and export them from this module.
export def core Define a custom command and export it from a module.
export def-env core Define a custom command that participates in the environment and export it from a module.
export extern core Define an extern and export it from a module.
export extern-wrapped core Define an extern with a custom code block and export it from a module.
export module core Export a custom module from a module.
export use core Use definitions from a module and export them from this module.
export-env env Run a block and preserve its environment in a current scope.
extern core Define a signature for an external command.
extern-wrapped core Define a signature for an external command with a custom code block.
fill conversions Fill and Align.
filter filters Filter values based on a predicate closure.
find filters Searches terms in the input.
first filters Return only the first several rows of the input. Counterpart of `last`. Opposite of `skip`.
flatten filters Flatten the table.
fmt conversions Format a number.
for core Loop over a range.
format strings Format columns into a string using a simple pattern.
format date date Format a given date using a format string.
format duration strings Outputs duration with a specified unit of time.
format filesize strings Converts a column of filesizes to some specified format.
from formats Parse a string or binary data into structured data.
from csv formats Parse text as .csv and create table.
from eml formats Parse text as .eml and create record.
from ics formats Parse text as .ics and create table.
from ini formats Parse text as .ini and create table.
from json formats Convert from json to structured data.
from nuon formats Convert from nuon to structured data.
from ods formats Parse OpenDocument Spreadsheet(.ods) data and create table.
from ssv formats Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2.
from toml formats Parse text as .toml and create record.
from tsv formats Parse text as .tsv and create table.
from url formats Parse url-encoded string as a record.
from vcf formats Parse text as .vcf and create table.
from xlsx formats Parse binary Excel(.xlsx) data and create table.
from xml formats Parse text as .xml and create record.
from yaml formats Parse text as .yaml/.yml and create table.
from yml formats Parse text as .yaml/.yml and create table.
g shells Switch to a given shell, or list all shells if no given shell number.
get filters Extract data using a cell path.
glob filesystem Creates a list of files and/or folders based on the glob pattern provided.
grid viewers Renders the output to a textual terminal grid.
group filters Groups input into groups of `group_size`.
group-by filters Splits a list or table into groups, and returns a record containing those groups.
gstat prompt Get the git status of a repo
hash hash Apply hash function.
hash md5 hash Hash a value using the md5 hash algorithm
hash sha256 hash Hash a value using the sha256 hash algorithm
headers filters Use the first row of the table as column names.
help core Display help information about different parts of Nushell.
help aliases core Show help on nushell aliases.
help commands core Show help on nushell commands.
help externs core Show help on nushell externs.
help modules core Show help on nushell modules.
help operators core Show help on nushell operators.
hide core Hide definitions in the current scope.
hide-env core Hide environment variables in the current scope.
histogram chart Creates a new table with a histogram based on the column name passed in.
history misc Get the command history.
history session misc Get the command history session.
http network Various commands for working with http methods.
http delete network Delete the specified resource.
http get network Fetch the contents from a URL.
http head network Get the headers from a URL.
http options network Requests permitted communication options for a given URL.
http patch network Patch a body to a URL.
http post