Command Reference

CommandBeschreibung
aggPerforms a series of aggregations from a group-by
agg-groupscreates an agg_groups expression
aliasAlias a command (with optional flags) to a new name
allTest if every element of the input fulfills a predicate expression.
all-falseReturns true if all values are false
all-trueReturns true if all values are true
andIncludes an AND clause for a query Includes an AND clause for an expression
ansiOutput ANSI codes to change color.
ansi gradientDraw text with a provided start and end code making a gradient
ansi stripStrip ANSI escape sequences from a string
anyTests if any element of the input fulfills a predicate expression.
appendAppends a new dataframe Append any number of rows to a table.
arg-maxReturn index for max value in series
arg-minReturn index for min value in series
arg-sortReturns indexes for a sorted series
arg-trueReturns indexes where values are true
arg-uniqueReturns indexes for unique values
arg-whereCreates an expression that returns the arguments where expression is true
asCreates an alias for a column selection Creates an alias for a column selection Creates an alias expression
as-dateConverts string to date.
as-datetimeConverts string to datetime.
astPrint the abstract syntax tree (ast) for a pipeline.
benchmarkTime the running time of a block
bitsVarious commands for working with bits
bits andPerforms bitwise and for integers
bits notPerforms logical negation on each bit
bits orPerforms bitwise or for integers
bits rolBitwise rotate left for integers
bits rorBitwise rotate right for integers
bits shlBitwise shift left for integers
bits shrBitwise shift right for integers
bits xorPerforms bitwise xor for integers
build-stringCreate a string from the arguments.
bytesVarious commands for working with byte data
bytes addAdd specified bytes to the input
bytes atGet 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 buildCreate bytes from the arguments.
bytes collectConcatenate multiple binary into a single binary, with an optional separator between each
bytes ends-withCheck if bytes ends with a pattern
bytes index-ofReturns start index of first occurrence of pattern in bytes, or -1 if no match
bytes lengthOutput the length of any bytes in the pipeline
bytes removeRemove bytes
bytes replaceFind and replace binary
bytes reverseReverse every bytes in the pipeline
bytes starts-withCheck if bytes starts with a pattern
cacheCaches operations in a new LazyFrame
calDisplay a calendar.
cdChange directory.
charOutput special characters (e.g., 'newline').
clearClear the terminal.
colCreates a named column expression
collectCollects a query from a database database connection Collect the stream and pass it to a block. Collect lazy dataframe into eager dataframe
columnsShow dataframe columns Show the columns in the input.
commandlineView or modify the current command line input buffer
compactCreates a table with non-empty rows.
completeComplete the external piped in, collecting outputs and exit code
concat-strCreates a concat string expression
concatenateConcatenates strings with other array
configEdit nushell configuration files
config envEdit nu environment configurations
config nuEdit nu configurations
config resetReset nushell environment configurations to default, and saves old config files in the config location as oldconfig.nu and oldenv.nu
containsChecks if a pattern is contained in a string
countcreates a count expression
count-nullCounts null values
cpCopy files.
cumulativeCumulative calculation for a series
dateDate-related commands
date formatFormat a given date using a format string.
date humanizePrint a 'humanized' format for the date, relative to now.
date list-timezoneList supported time zones.
date nowGet the current date.
date to-recordConvert the date into a structured table.
date to-tableConvert the date into a structured table.
date to-timezoneConvert a date to a given time zone.
debugDebug print the value(s) piped in.
decodeDecode bytes as a string.
decode base64Base64 decode a value
defDefine a custom command
def-envDefine a custom command, which participates in the caller environment
defaultSets a default row's column if missing.
describeDescribe the type and structure of the value(s) piped in. Describes connection and query of the DB object Describes dataframes numeric columns
detect columnsAttempt to automatically split text into multiple columns
df-notInverts boolean mask
doRun a block
dropCreates a new dataframe by dropping the selected columns Remove the last several rows of the input. Counterpart of 'skip'. Opposite of 'last'.
drop columnRemove the last number of columns. If you want to remove columns by name, try 'reject'.
drop nthDrop the selected rows.
drop-duplicatesDrops duplicate values in dataframe
drop-nullsDrops null values in dataframe
dtypesShow dataframe data types
duFind disk usage sizes of specified items.
dummiesCreates a new dataframe with dummy variables
eachRun a block on each row of input
each whileRun a block on each element of input until a null is found
echoReturns its arguments, ignoring the piped-in value.
encodeEncode an UTF-8 string into other kind of representations.
encode base64Base64 encode a value
enterEnters a new shell at the given path.
envDisplay current environment variables
error makeCreate an error.
everyShow (or skip) every n-th row, starting from the first one.
execExecute a command, replacing the current process.
exitExit a Nu shell or exit Nu entirely.
explodecreates an explode expression
exportExport definitions or environment variables from a module.
export aliasDefine an alias and export it from a module
export defDefine a custom command and export it from a module
export def-envDefine a custom command that participates in the environment and export it from a module
export externDefine an extern and export it from a module
export useUse definitions from a module and export them from this module
export-envRun a block and preserve its environment in a current scope.
expr-notcreates a not expression
externDefine a signature for an external command
fetchcollects the lazyframe to the selected rows Fetch the contents from a URL.
fieldCreates column expression for database
fill-naReplaces NA values with the given expression
fill-nullReplaces NULL values with the given expression
filterFilter dataframe based in expression
filter-withFilters dataframe using a mask or expression as reference
findSearches terms in the input or for elements of the input that satisfies the predicate.
firstShow 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'.
flattencreates a flatten expression Flatten the table.
fmtFormat a number
fnCreates function expression for a select operation
forLoop over a range
formatFormat columns into a string using a simple pattern.
format filesizeConverts a column of filesizes to some specified format
fromParse a string or binary data into structured data
from csvParse text as .csv and create table.
from emlParse text as .eml and create table.
from icsParse text as .ics and create table.
from iniParse text as .ini and create table
from jsonConvert from json to structured data
from nuonConvert from nuon to structured data
from odsParse OpenDocument Spreadsheet(.ods) data and create table.
from ssvParse text as space-separated values and create a table. The default minimum number of spaces counted as a separator is 2.
from tableSelect section from query statement for a DB
from tomlParse text as .toml and create table.
from tsvParse text as .tsv and create table.
from urlParse url-encoded string as a table.
from vcfParse text as .vcf and create table.
from xlsxParse binary Excel(.xlsx) data and create table.
from xmlParse text as .xml and create table.
from yamlParse text as .yaml/.yml and create table.
from ymlParse text as .yaml/.yml and create table.
gSwitch to a given shell, or list all shells if no given shell number.
getCreates dataframe with the selected columns Extract data using a cell path.
get-dayGets day from date
get-hourGets hour from date
get-minuteGets minute from date
get-monthGets month from date
get-nanosecondGets nanosecond from date
get-ordinalGets ordinal from date
get-secondGets second from date
get-weekGets week from date
get-weekdayGets weekday from date
get-yearGets year from date
globCreates a list of files and/or folders based on the glob pattern provided.
gridRenders the output to a textual terminal grid.
groupGroups input into groups of `group_size`.
group-byGroup-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
gstatGet the git status of a repo
hashApply hash function.
hash base64Deprecated command
hash md5Hash a value using the md5 hash algorithm
hash sha256Hash a value using the sha256 hash algorithm
headersUse the first row of the table as column names.
helpDisplay help information about commands.
hideHide definitions in the current scope
hide-envHide environment variables in the current scope
histogramCreates a new table with a histogram based on the column name passed in.
historyGet the command history
history sessionGet the command history session
ifConditionally run a block.
ignoreIgnore the output of the previous command in the pipeline
incIncrement a value or version. Optionally use the column of a table.
inputGet input from the user.
insertInsert a new column.
intoCommands to convert data from one type to another.
into binaryConvert value to a binary primitive
into boolConvert value to boolean
into datetimeConvert text into a datetime
into dbConverts the input into an open db connection
into decimalConvert text into a decimal
into dfConverts a list, table or record into a dataframe
into durationConvert value to duration
into filesizeConvert value to filesize
into intConvert value to integer
into lazyConverts a dataframe into a lazy dataframe
into nuConverts 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 sqliteConvert table into a sqlite database
into stringConvert value to string
is-adminCheck if nushell is running with administrator or root privileges
is-duplicatedCreates mask indicating duplicated values
is-emptyCheck for empty values.
is-inChecks if elements from a series are contained in right series Creates an is-in expression
is-not-nullCreates mask where value is not null creates a is not null expression
is-nullCreates mask where value is null creates a is null expression
is-uniqueCreates mask indicating unique values
joinJoins with another table or derived table. Default join type is inner Joins a lazy frame with other lazy frame
keybindingsKeybindings related commands
keybindings defaultList default keybindings
keybindings listList available options that can be used to create keybindings
keybindings listenGet input from the user.
killKill a process using the process id.
lastCreates 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'.
lengthCount the number of elements in the input.
letCreate a variable and give it a value.
let-envCreate an environment variable and give it a value.
limitLimit result from query
linesConverts input to lines
listAggregates a group to a Series
litCreates a literal expression
load-envLoads an environment update from a record.
lowercaseLowercase the strings in the column
lsList the files in a directory.
ls-dfLists stored dataframes
mathUse mathematical functions as aggregate functions on a list of numbers or tables.
math absReturns absolute values of a list of numbers
math avgFinds the average of a list of numbers or tables
math ceilApplies the ceil function to a list of numbers
math evalEvaluate a math expression into a number
math floorApplies the floor function to a list of numbers
math maxFinds the maximum within a list of numbers or tables
math medianGets the median of a list of numbers
math minFinds the minimum within a list of numbers or tables
math modeGets the most frequent element(s) from a list of numbers or tables
math productFinds the product of a list of numbers or tables
math roundApplies the round function to a list of numbers
math sqrtApplies the square root function to a list of numbers
math stddevFinds the stddev of a list of numbers or tables
math sumFinds the sum of a list of numbers or tables
math varianceFinds the variance of a list of numbers or tables
maxCreates a max expression Aggregates columns to their max value
meanCreates a mean expression for an aggregation Aggregates columns to their mean value
medianCreates a median expression for an aggregation Aggregates columns to their median value
meltUnpivot a DataFrame from wide to long format
mergeMerge the input with a record or table, overwriting values in matching columns.
metadataGet the metadata for items in the stream
minCreates a min expression Aggregates columns to their min value
mkdirMake directories, creates intermediary directories as required.
moduleDefine a custom module
moveMove columns before or after other columns
mvMove files or directories.
nSwitch to the next shell.
n-uniqueCounts unique values creates a n-unique expression
nu-checkValidate and parse input content
nu-highlightSyntax highlight the input string.
openLoad a file into a cell, converting to table if possible (avoid by appending '--raw').
open-dbOpen a database
open-dfOpens csv, json, arrow, or parquet file to create dataframe
orIncludes an OR clause for a query Includes an OR clause for an expression
order-byOrders by query
otherwisecompletes a when expression
overAdds a partition to an expression function
overlayCommands for manipulating overlays.
overlay hideHide an active overlay
overlay listList all active overlays
overlay newCreate an empty overlay
overlay useUse definitions from a module as an overlay
pSwitch to the previous shell.
par-eachRun a block on each element of input in parallel
parseParse columns from string data using a simple pattern.
pathExplore and manipulate paths.
path basenameGet the final component of a path
path dirnameGet the parent directory of a path
path existsCheck whether a path exists
path expandTry to expand a path to its absolute form
path joinJoin a structured path or a list of path parts.
path parseConvert a path into structured data.
path relative-toGet a path as relative to another path.
path splitSplit a path into a list based on the system's path separator.
path typeGet the type of the object a path refers to (e.g., file, dir, symlink)
portGet a free port from system
postPost a body to a URL.
prependPrepend any number of rows to a table.
printPrint the given values to stdout
psView information about system processes.
quantileAggregates the columns to the selected quantile Aggregates the columns to the selected quantile
queryShow all the query commands
query dbQuery a database using SQL.
query dfQuery dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause.
query jsonexecute json query on json file (open --raw <file> | query json 'query string')
query webexecute selector query on html/web
query xmlexecute xpath query on xml
randomGenerate a random value.
random boolGenerate a random boolean value
random charsGenerate random chars
random decimalGenerate a random decimal within a range [min..max]
random diceGenerate a random dice roll
random integerGenerate a random integer [min..max]
random uuidGenerate a random uuid4 string
rangeReturn only the selected rows.
reduceAggregate a list table to a single value using an accumulator block.
registerRegister a plugin
rejectRemove the given columns from the table. If you want to remove rows, try 'drop'.
renameRename a dataframe column Creates a new table with columns renamed.
replaceReplace the leftmost (sub)string by a regex pattern
replace-allReplace all (sub)strings by a regex pattern
reverseReverses the table. Reverses the LazyFrame
rmRemove file(s).
rollRolling commands for tables
roll downRoll table rows down
roll leftRoll table columns left
roll rightRoll table columns right
roll upRoll table rows up
rollingRolling calculation for a series
rotateRotates a table clockwise (default) or counter-clockwise (use --ccw flag).
run-externalRuns external command
sampleCreate sample dataframe
saveSave a file.
schemaShow sqlite database information, including its schema.
selectCreates a select statement for a DB Down-select table to only these columns. Selects columns from lazyframe
seqPrint sequences of numbers.
seq charPrint sequence of chars
seq datePrint sequences of dates
setSets value where given mask is true
set-with-idxSets value in the given index
shapeShows column and row size for a dataframe
shellsLists all open shells.
shiftShifts the values by a given period
shuffleShuffle rows randomly.
sizeGather word count statistics on the text.
skipSkip the first several rows of the input. Counterpart of 'drop'. Opposite of 'first'.
skip untilSkip elements of the input until a predicate is true.
skip whileSkip elements of the input while a predicate is true.
sleepDelay for a specified amount of time.
sliceCreates new dataframe from a slice of rows
sortSort in increasing order.
sort-bySort by the given columns, in increasing order. sorts a lazy dataframe based on expression(s)
sourceRuns a script file in the current context.
source-envSource the environment from a source file into the current environment.
splitSplit contents across desired subcommand (like row, column) via the separator.
split charsSplit a string's characters into separate rows
split columnSplit a string into multiple columns using a separator
split listSplit a list into multiple lists using a separator
split rowSplit a string into multiple rows using a separator
split wordsSplit a string's words into separate rows
split-byCreate a new table splitted.
stdCreates a std expression for an aggregation Aggregates columns to their std value
strVarious commands for working with string data
str camel-caseConvert a string to camelCase
str capitalizeCapitalize first letter of text
str collect'str collect' is deprecated. Please use 'str join' instead.
str containsChecks if input contains string
str distancecompare two strings and return the edit distance/levenshtein distance
str downcaseMake text lowercase
str ends-withCheck if an input ends with a string
str find-replaceDeprecated command
str index-ofReturns start index of first occurrence of string in input, or -1 if no match
str joinConcatenate multiple strings into a single string, with an optional separator between each
str kebab-caseConvert a string to kebab-case
str lengthOutput the length of any strings in the pipeline
str lpadLeft-pad a string to a specific length
str pascal-caseConvert a string to PascalCase
str replaceFind and replace text
str reverseReverse every string in the pipeline
str rpadRight-pad a string to a specific length
str screaming-snake-caseConvert a string to SCREAMING_SNAKE_CASE
str snake-caseConvert a string to snake_case
str starts-withCheck if an input starts with a string
str substringGet 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-caseConvert a string to Title Case
str to-datetimeDeprecated command
str to-decimalDeprecated command
str to-intDeprecated command
str trimTrim whitespace or specific character
str upcaseMake text uppercase
str-lengthsGet lengths of all strings
str-sliceSlices the string from the start position until the selected length
strftimeFormats date based on string rule
sumCreates a sum expression for an aggregation Aggregates columns to their sum value
sysView information about the system.
tableRender the table.
takeCreates new dataframe using the given indices Take only the first n elements.
take untilTake elements of the input until a predicate is true.
take whileTake elements of the input while a predicate is true.
term sizeReturns a record containing the number of columns (width) and rows (height) of the terminal
testing-dbTemporal Command: Create query object
toTranslate structured data to a format
to arrowSaves dataframe to arrow file
to csvSaves dataframe to csv file Convert table into .csv text
to htmlConvert table into simple HTML
to jsonConverts table data into JSON text.
to mdConvert table into simple Markdown
to nuonConverts table data into Nuon (Nushell Object Notation) text.
to parquetSaves dataframe to parquet file
to textConverts data into simple text.
to tomlConvert table into .toml text
to tsvConvert table into .tsv text
to urlConvert table into url-encoded text
to xmlConvert table into .xml text
to yamlConvert table into .yaml/.yml text
touchCreates one or more files.
transposeTransposes the table contents so rows become columns and columns become rows.
tutorRun the tutorial. To begin, run: tutor
uniqReturn the distinct values in the input.
uniqueReturns unique values from a dataframe
updateUpdate an existing column to have a new value.
update cellsUpdate the table cells.
uppercaseUppercase the strings in the column
upsertUpdate an existing column to have a new value, or insert a new column.
urlApply url function.
url hostGet the host of a URL
url pathGet the path of a URL
url queryGet the query string of a URL
url schemeGet the scheme (e.g. http, file) of a URL
useUse definitions from a module
value-countsReturns a dataframe with the counts for unique values in series
varCreate a var expression for an aggregation Aggregates columns to their var value
versionDisplay Nu version.
view-sourceView a block, module, or a definition
watchWatch for file changes and execute Nu code when they happen.
whenCreates and modifies a when expression
whereIncludes a where statement for a query Filter values based on a condition.
whichFinds a program file, alias or custom command.
windowCreates a sliding window of `window_size` that slide by n rows/elements across input.
with-columnAdds a series to the dataframe
with-envRuns a block with an environment variable set.
wrapWrap the value into a column.
zipCombine a stream with the input