Command Reference

To see all commands in Nushell, run help commands.

CommandCategoriesDescription
agglazyframe Performs a series of aggregations from a group-by
agg-groupsexpression creates an agg_groups expression
aliascore Alias a command (with optional flags) to a new name
allfilters Test if every element of the input fulfills a predicate expression.
all-falsedataframe Returns true if all values are false
all-truedataframe Returns true if all values are true
anddatabase db-expression Includes an AND clause for a query Includes an AND clause for an expression
ansiplatform Output ANSI codes to change color.
ansi gradientplatform Draw text with a provided start and end code making a gradient
ansi stripplatform Strip ANSI escape sequences from a string
anyfilters Tests if any element of the input fulfills a predicate expression.
appenddataframe filters Appends a new dataframe Append any number of rows to a table.
arg-maxdataframe Return index for max value in series
arg-mindataframe Return index for min value in series
arg-sortdataframe Returns indexes for a sorted series
arg-truedataframe Returns indexes where values are true
arg-uniquedataframe Returns indexes for unique values
arg-whereexpression Creates an expression that returns the arguments where expression is true
asdatabase db-expression expression Creates an alias for a column selection Creates an alias for a column selection Creates an alias expression
as-datedataframe Converts string to date.
as-datetimedataframe Converts string to datetime.
astcore Print the abstract syntax tree (ast) for a pipeline.
benchmarksystem Time the running time of a block
bitsbits Various commands for working with bits
bits andbits Performs bitwise and for integers
bits notbits Performs logical negation on each bit
bits orbits Performs bitwise or for integers
bits rolbits Bitwise rotate left for integers
bits rorbits Bitwise rotate right for integers
bits shlbits Bitwise shift left for integers
bits shrbits Bitwise shift right for integers
bits xorbits Performs bitwise xor for integers
build-stringstrings Create a string from the arguments.
bytesbytes Various commands for working with byte data
bytes addbytes Add specified bytes to the input
bytes atbytes Get bytes defined by a range. Note that the start is included but the end is excluded, and that the first byte is index 0.
bytes buildbytes Create bytes from the arguments.
bytes collectbytes Concatenate multiple binary into a single binary, with an optional separator between each
bytes ends-withbytes Check if bytes ends with a pattern
bytes index-ofbytes Returns start index of first occurrence of pattern in bytes, or -1 if no match
bytes lengthbytes Output the length of any bytes in the pipeline
bytes removebytes Remove bytes
bytes replacebytes Find and replace binary
bytes reversebytes Reverse every bytes in the pipeline
bytes starts-withbytes Check if bytes starts with a pattern
cachelazyframe Caches operations in a new LazyFrame
calgenerators Display a calendar.
cdfilesystem Change directory.
charstrings Output special characters (e.g., 'newline').
clearplatform Clear the terminal.
colexpression Creates a named column expression
collectdatabase filters lazyframe Collects a query from a database database connection Collect the stream and pass it to a block. Collect lazy dataframe into eager dataframe
columnsdataframe filters Show dataframe columns Show the columns in the input.
commandlinecore View or modify the current command line input buffer
compactfilters Creates a table with non-empty rows.
completesystem Complete the external piped in, collecting outputs and exit code
concat-strexpression Creates a concat string expression
concatenatedataframe Concatenates strings with other array
configenv Edit nushell configuration files
config envenv Edit nu environment configurations
config nuenv Edit nu configurations
config resetenv Reset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu
containsdataframe Checks if a pattern is contained in a string
countexpression creates a count expression
count-nulldataframe Counts null values
cpfilesystem Copy files.
cumulativedataframe Cumulative calculation for a series
datedate Date-related commands
date formatdate Format a given date using a format string.
date humanizedate Print a 'humanized' format for the date, relative to now.
date list-timezonedate List supported time zones.
date nowdate Get the current date.
date to-recorddate Convert the date into a structured table.
date to-tabledate Convert the date into a structured table.
date to-timezonedate Convert a date to a given time zone.
debugcore Debug print the value(s) piped in.
decodestrings Decode bytes as a string.
decode base64hash Base64 decode a value
defcore Define a custom command
def-envcore Define a custom command, which participates in the caller environment
defaultfilters Sets a default row's column if missing.
describecore database dataframe Describe the type and structure of the value(s) piped in. Describes connection and query of the DB object Describes dataframes numeric columns
detect columnsstrings Attempt to automatically split text into multiple columns
df-notdataframe Inverts boolean mask
docore Run a block
dropdataframe filters Creates a new dataframe by dropping the selected columns Remove the last several rows of the input. Counterpart of 'skip'. Opposite of 'last'.
drop columnfilters Remove the last number of columns. If you want to remove columns by name, try 'reject'.
drop nthfilters Drop the selected rows.
drop-duplicatesdataframe Drops duplicate values in dataframe
drop-nullsdataframe Drops null values in dataframe
dtypesdataframe Show dataframe data types
ducore Find disk usage sizes of specified items.
dummiesdataframe Creates a new dataframe with dummy variables
eachfilters Run a block on each row of input
each whilefilters Run a block on each element of input until a null is found
echocore Returns its arguments, ignoring the piped-in value.
encodestrings Encode an UTF-8 string into other kind of representations.
encode base64hash Base64 encode a value
entershells Enters a new shell at the given path.
envenv Display current environment variables
error makecore Create an error.
everyfilters Show (or skip) every n-th row, starting from the first one.
execsystem Execute a command, replacing the current process.
exitshells Exit a Nu shell or exit Nu entirely.
explodeexpression creates an explode expression
exportcore Export definitions or environment variables from a module.
export aliascore Define an alias and export it from a module
export defcore Define a custom command and export it from a module
export def-envcore Define a custom command that participates in the environment and export it from a module
export externcore Define an extern and export it from a module
export usecore Use definitions from a module and export them from this module
export-envenv Run a block and preserve its environment in a current scope.
expr-notexpression creates a not expression
externcore Define a signature for an external command
fetchlazyframe network collects the lazyframe to the selected rows Fetch the contents from a URL.
fielddb-expression Creates column expression for database
fill-nalazyframe Replaces NA values with the given expression
fill-nulllazyframe Replaces NULL values with the given expression
filterlazyframe Filter dataframe based in expression
filter-withdataframe or lazyframe Filters dataframe using a mask or expression as reference
findfilters Searches terms in the input or for elements of the input that satisfies the predicate.
firstdataframe expression filters Show only the first number of rows. creates a first expression Return only the first several rows of the input. Counterpart of 'last'. Opposite of 'skip'.
flattenexpression filters creates a flatten expression Flatten the table.
fmtconversions Format a number
fndb-expression Creates function expression for a select operation
forcore Loop over a range
formatstrings Format columns into a string using a simple pattern.
format filesizestrings Converts a column of filesizes to some specified format
fromformats Parse a string or binary data into structured data
from csvformats Parse text as .csv and create table.
from emlformats Parse text as .eml and create table.
from icsformats Parse text as .ics and create table.
from iniformats Parse text as .ini and create table
from jsonformats Convert from json to structured data
from nuonexperimental Convert from nuon to structured data
from odsformats Parse OpenDocument Spreadsheet(.ods) data and create table.
from ssvformats Parse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2.
from tabledatabase Select section from query statement for a DB
from tomlformats Parse text as .toml and create table.
from tsvformats Parse text as .tsv and create table.
from urlformats Parse url-encoded string as a table.
from vcfformats Parse text as .vcf and create table.
from xlsxformats Parse binary Excel(.xlsx) data and create table.
from xmlformats Parse text as .xml and create table.
from yamlformats Parse text as .yaml/.yml and create table.
from ymlformats Parse text as .yaml/.yml and create table.
gshells Switch to a given shell, or list all shells if no given shell number.
getdataframe filters Creates dataframe with the selected columns Extract data using a cell path.
get-daydataframe Gets day from date
get-hourdataframe Gets hour from date
get-minutedataframe Gets minute from date
get-monthdataframe Gets month from date
get-nanoseconddataframe Gets nanosecond from date
get-ordinaldataframe Gets ordinal from date
get-seconddataframe Gets second from date
get-weekdataframe Gets week from date
get-weekdaydataframe Gets weekday from date
get-yeardataframe Gets year from date
globfilesystem Creates a list of files and/or folders based on the glob pattern provided.
gridviewers Renders the output to a textual terminal grid.
groupfilters Groups input into groups of `group_size`.
group-bydatabase default lazyframe Group-by query Split a table into groups based on one column's values, and return a record with those groups. Creates a group-by object that can be used for other aggregations
gstatprompt Get the git status of a repo
hashhash Apply hash function.
hash base64deprecated Deprecated command
hash md5default Hash a value using the md5 hash algorithm
hash sha256default Hash a value using the sha256 hash algorithm
headersfilters Use the first row of the table as column names.
helpcore Display help information about commands.
hidecore Hide definitions in the current scope
hide-envcore Hide environment variables in the current scope
histogramdefault Creates a new table with a histogram based on the column name passed in.
historymisc Get the command history
history sessionmisc Get the command history session
ifcore Conditionally run a block.
ignorecore Ignore the output of the previous command in the pipeline
incdefault Increment a value or version. Optionally use the column of a table.
inputplatform Get input from the user.
insertfilters Insert a new column.
intoconversions Commands to convert data from one type to another.
into binaryconversions Convert value to a binary primitive
into boolconversions Convert value to boolean
into datetimeconversions Convert text into a datetime
into dbdatabase Converts the input into an open db connection
into decimaldefault Convert text into a decimal
into dfdataframe Converts a list, table or record into a dataframe
into durationconversions Convert value to duration
into filesizeconversions Convert value to filesize
into intconversions Convert value to integer
into lazylazyframe Converts a dataframe into a lazy dataframe
into nudataframe db-expression expression Converts a section of the dataframe into nushell Table Convert a db expression into a nu value for access and exploration Convert expression into a nu value for access and exploration
into sqliteconversions Convert table into a sqlite database
into stringconversions Convert value to string
is-admincore Check if nushell is running with administrator or root privileges
is-duplicateddataframe Creates mask indicating duplicated values
is-emptyfilters Check for empty values.
is-indataframe expression Checks if elements from a series are contained in right series Creates an is-in expression
is-not-nulldataframe expression Creates mask where value is not null creates a is not null expression
is-nulldataframe expression Creates mask where value is null creates a is null expression
is-uniquedataframe Creates mask indicating unique values
joindatabase lazyframe Joins with another table or derived table. Default join type is inner Joins a lazy frame with other lazy frame
keybindingsplatform Keybindings related commands
keybindings defaultplatform List default keybindings
keybindings listplatform List available options that can be used to create keybindings
keybindings listenplatform Get input from the user.
killplatform Kill a process using the process id.
lastdataframe expression filters Creates new dataframe with tail rows or creates a last expression creates a last expression Return only the last several rows of the input. Counterpart of 'first'. Opposite of 'drop'.
lengthfilters Count the number of elements in the input.
letcore Create a variable and give it a value.
let-envenv Create an environment variable and give it a value.
limitdatabase Limit result from query
linesfilters Converts input to lines
listexpression Aggregates a group to a Series
litexpression Creates a literal expression
load-envfilesystem Loads an environment update from a record.
lowercasedataframe Lowercase the strings in the column
lsfilesystem List the files in a directory.
ls-dfdataframe Lists stored dataframes
mathmath Use mathematical functions as aggregate functions on a list of numbers or tables.
math absmath Returns absolute values of a list of numbers
math avgmath Finds the average of a list of numbers or tables
math ceilmath Applies the ceil function to a list of numbers
math evalmath Evaluate a math expression into a number
math floormath Applies the floor function to a list of numbers
math maxmath Finds the maximum within a list of numbers or tables
math medianmath Gets the median of a list of numbers
math minmath Finds the minimum within a list of numbers or tables
math modemath Gets the most frequent element(s) from a list of numbers or tables
math productmath Finds the product of a list of numbers or tables
math roundmath Applies the round function to a list of numbers
math sqrtmath Applies the square root function to a list of numbers
math stddevmath Finds the stddev of a list of numbers or tables
math summath Finds the sum of a list of numbers or tables
math variancemath Finds the variance of a list of numbers or tables
maxexpression lazyframe Creates a max expression Aggregates columns to their max value
meanexpression lazyframe Creates a mean expression for an aggregation Aggregates columns to their mean value
medianexpression lazyframe Creates a median expression for an aggregation Aggregates columns to their median value
meltdataframe Unpivot a DataFrame from wide to long format
mergefilters Merge the input with a record or table, overwriting values in matching columns.
metadatacore Get the metadata for items in the stream
minexpression lazyframe Creates a min expression Aggregates columns to their min value
mkdirfilesystem Make directories, creates intermediary directories as required.
modulecore Define a custom module
movefilters Move columns before or after other columns
mvfilesystem Move files or directories.
nshells Switch to the next shell.
n-uniquedataframe expression Counts unique values creates a n-unique expression
nu-checkstrings Validate and parse input content
nu-highlightstrings Syntax highlight the input string.
openfilesystem Load a file into a cell, converting to table if possible (avoid by appending '--raw').
open-dbdatabase Open a database
open-dfdataframe Opens csv, json, arrow, or parquet file to create dataframe
ordatabase db-expression Includes an OR clause for a query Includes an OR clause for an expression
order-bydatabase Orders by query
otherwiseexpression completes a when expression
overdb-expression Adds a partition to an expression function
overlaycore Commands for manipulating overlays.
overlay hidecore Hide an active overlay
overlay listcore List all active overlays
overlay newcore Create an empty overlay
overlay usecore Use definitions from a module as an overlay
pshells Switch to the previous shell.
par-eachfilters Run a block on each element of input in parallel
parsestrings Parse columns from string data using a simple pattern.
pathdefault Explore and manipulate paths.
path basenamedefault Get the final component of a path
path dirnamedefault Get the parent directory of a path
path existsdefault Check whether a path exists
path expanddefault Try to expand a path to its absolute form
path joindefault Join a structured path or a list of path parts.
path parsedefault Convert a path into structured data.
path relative-todefault Get a path as relative to another path.
path splitdefault Split a path into a list based on the system's path separator.
path typedefault Get the type of the object a path refers to (e.g., file, dir, symlink)
portnetwork Get a free port from system
postnetwork Post a body to a URL.
prependfilters Prepend any number of rows to a table.
printstrings Print the given values to stdout
pssystem View information about system processes.
quantileexpression lazyframe Aggregates the columns to the selected quantile Aggregates the columns to the selected quantile
queryfilters Show all the query commands
query dbdatabase Query a database using SQL.
query dfdataframe Query dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause.
query jsonfilters execute json query on json file (open --raw <file> | query json 'query string')
query webnetwork execute selector query on html/web
query xmlfilters execute xpath query on xml
randomrandom Generate a random value.
random boolrandom Generate a random boolean value
random charsrandom Generate random chars
random decimalrandom Generate a random decimal within a range [min..max]
random dicerandom Generate a random dice roll
random integerrandom Generate a random integer [min..max]
random uuidrandom Generate a random uuid4 string
rangefilters Return only the selected rows.
reducedefault Aggregate a list table to a single value using an accumulator block.
registercore Register a plugin
rejectfilters Remove the given columns from the table. If you want to remove rows, try 'drop'.
renamedataframe or lazyframe filters Rename a dataframe column Creates a new table with columns renamed.
replacedataframe Replace the leftmost (sub)string by a regex pattern
replace-alldataframe Replace all (sub)strings by a regex pattern
reversefilters lazyframe Reverses the table. Reverses the LazyFrame
rmfilesystem Remove file(s).
rollfilters Rolling commands for tables
roll downfilters Roll table rows down
roll leftfilters Roll table columns left
roll rightfilters Roll table columns right
roll upfilters Roll table rows up
rollingdataframe Rolling calculation for a series
rotatefilters Rotates a table clockwise (default) or counter-clockwise (use --ccw flag).
run-externalsystem Runs external command
sampledataframe Create sample dataframe
savefilesystem Save a file.
schemadatabase Show sqlite database information, including its schema.
selectdatabase filters lazyframe Creates a select statement for a DB Down-select table to only these columns. Selects columns from lazyframe
seqgenerators Print sequences of numbers.
seq chargenerators Print sequence of chars
seq dategenerators Print sequences of dates
setdataframe Sets value where given mask is true
set-with-idxdataframe Sets value in the given index
shapedataframe Shows column and row size for a dataframe
shellsshells Lists all open shells.
shiftdataframe or lazyframe Shifts the values by a given period
shufflefilters Shuffle rows randomly.
sizestrings Gather word count statistics on the text.
skipfilters Skip the first several rows of the input. Counterpart of 'drop'. Opposite of 'first'.
skip untilfilters Skip elements of the input until a predicate is true.
skip whilefilters Skip elements of the input while a predicate is true.
sleepplatform Delay for a specified amount of time.
slicedataframe Creates new dataframe from a slice of rows
sortfilters Sort in increasing order.
sort-byfilters lazyframe Sort by the given columns, in increasing order. sorts a lazy dataframe based on expression(s)
sourcecore Runs a script file in the current context.
source-envcore Source the environment from a source file into the current environment.
splitstrings Split contents across desired subcommand (like row, column) via the separator.
split charsstrings Split a string's characters into separate rows
split columnstrings Split a string into multiple columns using a separator
split listfilters Split a list into multiple lists using a separator
split rowstrings Split a string into multiple rows using a separator
split wordsstrings Split a string's words into separate rows
split-bydefault Create a new table splitted.
stdexpression lazyframe Creates a std expression for an aggregation Aggregates columns to their std value
strstrings Various commands for working with string data
str camel-casestrings Convert a string to camelCase
str capitalizestrings Capitalize first letter of text
str collectdeprecated 'str collect' is deprecated. Please use 'str join' instead.
str containsstrings Checks if input contains string
str distancestrings compare two strings and return the edit distance/levenshtein distance
str downcasestrings Make text lowercase
str ends-withstrings Check if an input ends with a string
str find-replacedeprecated Deprecated command
str index-ofstrings Returns start index of first occurrence of string in input, or -1 if no match
str joinstrings Concatenate multiple strings into a single string, with an optional separator between each
str kebab-casestrings Convert a string to kebab-case
str lengthstrings Output the length of any strings in the pipeline
str lpadstrings Left-pad a string to a specific length
str pascal-casestrings Convert a string to PascalCase
str replacestrings Find and replace text
str reversestrings Reverse every string in the pipeline
str rpadstrings Right-pad a string to a specific length
str screaming-snake-casestrings Convert a string to SCREAMING_SNAKE_CASE
str snake-casestrings Convert a string to snake_case
str starts-withstrings Check if an input starts with a string
str substringdefault Get part of a string. Note that the start is included but the end is excluded, and that the first character of a string is index 0.
str title-casestrings Convert a string to Title Case
str to-datetimedeprecated Deprecated command
str to-decimaldeprecated Deprecated command
str to-intdeprecated Deprecated command
str trimdefault Trim whitespace or specific character
str upcasedefault Make text uppercase
str-lengthsdataframe Get lengths of all strings
str-slicedataframe Slices the string from the start position until the selected length
strftimedataframe Formats date based on string rule
sumexpression lazyframe Creates a sum expression for an aggregation Aggregates columns to their sum value
syssystem View information about the system.
tableviewers Render the table.
takedataframe filters Creates new dataframe using the given indices Take only the first n elements.
take untilfilters Take elements of the input until a predicate is true.
take whilefilters Take elements of the input while a predicate is true.
term sizeplatform Returns a record containing the number of columns (width) and rows (height) of the terminal
testing-dbdatabase Temporal Command: Create query object
toformats Translate structured data to a format
to arrowdataframe Saves dataframe to arrow file
to csvdataframe formats Saves dataframe to csv file Convert table into .csv text
to htmlformats Convert table into simple HTML
to jsonformats Converts table data into JSON text.
to mdformats Convert table into simple Markdown
to nuonexperimental Converts table data into Nuon (Nushell Object Notation) text.
to parquetdataframe Saves dataframe to parquet file
to textformats Converts data into simple text.
to tomlformats Convert table into .toml text
to tsvformats Convert table into .tsv text
to urlformats Convert table into url-encoded text
to xmlformats Convert table into .xml text
to yamlformats Convert table into .yaml/.yml text
touchfilesystem Creates one or more files.
transposedefault Transposes the table contents so rows become columns and columns become rows.
tutormisc Run the tutorial. To begin, run: tutor
uniqfilters Return the distinct values in the input.
uniquedataframe or lazyframe Returns unique values from a dataframe
updatefilters Update an existing column to have a new value.
update cellsfilters Update the table cells.
uppercasedataframe Uppercase the strings in the column
upsertfilters Update an existing column to have a new value, or insert a new column.
urlnetwork Apply url function.
url hostnetwork Get the host of a URL
url pathnetwork Get the path of a URL
url querynetwork Get the query string of a URL
url schemenetwork Get the scheme (e.g. http, file) of a URL
usecore Use definitions from a module
value-countsdataframe Returns a dataframe with the counts for unique values in series
varexpression lazyframe Create a var expression for an aggregation Aggregates columns to their var value
versiondefault Display Nu version.
view-sourcecore View a block, module, or a definition
watchfilesystem Watch for file changes and execute Nu code when they happen.
whenexpression Creates and modifies a when expression
wheredatabase filters Includes a where statement for a query Filter values based on a condition.
whichsystem Finds a program file, alias or custom command.
windowfilters Creates a sliding window of `window_size` that slide by n rows/elements across input.
with-columndataframe or lazyframe Adds a series to the dataframe
with-envenv Runs a block with an environment variable set.
wrapfilters Wrap the value into a column.
zipfilters Combine a stream with the input