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
all-falseReturns true if all values are false
all-trueReturns true if all values are true
all?Test if every element of the input matches a predicate.
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
any?Tests if any element of the input matches a predicate.
appendAppends a new dataframe
appendAppend 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
asCreates an alias expression
as-dateConverts string to date.
as-datetimeConverts string to datetime.
benchmarkTime the running time of a block
build-stringCreate a string from the arguments.
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
collectCollect lazy dataframe into eager dataframe
collectCollect the stream and pass it to a block.
columnsShow the columns in the input.
compactCreates a table with non-empty rows.
completeComplete the external piped in, collecting outputs and exit code
concatenateConcatenates strings with other array
configEdit nushell configuration files
config envEdit nu environment configurations
config nuEdit nu configurations
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.
dbDatabase commands
db andIncludes an AND clause for a query or expression
db asCreates an alias for a column selection
db colCreates column expression for database
db collectQuery a database using SQL.
db describeDescribes connection and query of the DB object
db fnCreates function expression for a select operation
db fromSelect section from query statement for a DB
db group-byGroup by query
db joinJoins with another table or derived table. Default join type is inner
db limitLimit result from query
db openOpen a database
db orIncludes an OR clause for a query or expression
db order-byOrders by query
db overAdds a partition to an expression function
db queryQuery a database using SQL.
db schemaShow database information, including its schema.
db selectCreates a select statement for a DB
db testingCreate query object
db whereIncludes a where statement for a query
debugDebug print the value(s) piped in.
decodeDecode bytes as a string.
defDefine a custom command
def-envDefine a custom command, which participates in the caller environment
defaultSets a default row's column if missing.
describeDescribes dataframes numeric columns
describeDescribe the type and structure of the value(s) piped in.
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
dropRemove the last number of rows or columns.
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.
eachRun a block on each element of input
each whileRun a block on each element of input until a $nothing is found
echoEcho the arguments back to the user.
empty?Check for empty values.
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 custom commands 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 envExport a block from a module that will be evaluated as an environment variable when imported.
export externDefine an extern and export it from a module
expr-notcreates a not expression
externDefine a signature for an external command
fetchcollects the lazyframe to the selected rows
fetchFetch the contents from a URL.
fill-naReplaces NA values with the given expression
fill-nullReplaces NULL values with the given 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.
firstCreates new dataframe with first rows
firstShow only the first number of rows.
flattenFlatten the table.
fmtFormat a number
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 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.
getCreates dataframe with the selected columns
getExtract 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-byCreates a groupby object that can be used for other aggregations
group-byCreate a new table grouped.
gstatGet the git status of a repo
hashApply hash function.
hash base64base64 encode or decode a value
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 symbols in the current scope
histogramCreates a new table with a histogram based on the column name passed in.
historyGet the command history
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 decimalConvert text into a decimal
into durationConvert value to duration
into filesizeConvert value to filesize
into intConvert value to integer
into stringConvert value to string
is-adminCheck if nushell is running with administrator or root privileges
is-duplicatedCreates mask indicating duplicated values
is-inChecks if elements from a series are contained in right series
is-not-nullCreates mask where value is not null
is-not-nullcreates a is not null expression
is-nullCreates mask where value is null
is-nullcreates a is null expression
is-uniqueCreates mask indicating unique values
joinJoins a lazy frame with other lazy frame
keepDeprecated command
keep untilDeprecated command
keep whileDeprecated command
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
lastShow only the last number of rows.
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.
linesConverts input to lines
listAggregates a group to a Series
litCreates a literal expression
load-envLoads an environment update from a record.
lsList the files in a directory.
ls-dfLists stored dataframes
matchDeprecated command
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
maxAggregates columns to their max value
maxCreates a max expression
meanAggregates columns to their mean value
meanCreates a mean expression for an aggregation
medianAggregates columns to their median value
medianCreates a median expression for an aggregation
meltUnpivot a DataFrame from wide to long format
mergeMerge a table into an input table
metadataGet the metadata for items in the stream
minAggregates columns to their min value
minCreates a min expression
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
n-uniquecreates a n-unique expression
nthDeprecated command
nu-highlightSyntax highlight the input string.
openLoad a file into a cell, converting to table if possible (avoid by appending '--raw').
open-dfOpens csv, json or parquet file to create dataframe
otherwisecompletes a when expression
overlayCommands for manipulating overlays.
overlay addAdd definitions from a module as an overlay
overlay listList all active overlays
overlay newCreate an empty overlay
overlay removeRemove an active 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 parts by a separator.
path typeGet the type of the object a path refers to (e.g., file, dir, symlink)
pivotDeprecated command
postPost a body to a URL.
prependPrepend any number of rows to a table.
printPrints the values given
psView information about system processes.
quantileAggregates the columns to the selected quantile
quantileAggregates the columns to the selected quantile
queryShow all the query commands
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
renameCreates 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 LazyFrame
reverseReverses the table.
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.
selectSelects columns from lazyframe
selectDown-select table to only these columns.
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 n elements of the input.
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-bysorts a lazy dataframe based on expression(s)
sort-bySort by the given columns, in increasing order.
sourceRuns a script file in the current context.
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 rowSplit a string into multiple rows using a separator
split-byCreate a new table splitted.
stdAggregates columns to their std value
stdCreates a std expression for an aggregation
strVarious commands for working with string data
str camel-caseConvert a string to camelCase
str capitalizeCapitalize first letter of text
str collectConcatenate multiple strings into a single string, with an optional separator between each
str containsChecks if string contains pattern
str downcaseMake text lowercase
str ends-withCheck if a string ends with a pattern
str find-replaceDeprecated command
str index-ofReturns start index of first occurrence of pattern in string, or -1 if no match
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 string starts with a pattern
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
sumAggregates columns to their sum value
sumCreates a sum expression for an aggregation
sysView information about the system.
tableRender the table.
takeCreates new dataframe using the given indices
takeTake the first n elements of the input.
take untilTake elements of the input until a predicate is true.
take whileTake elements of the input while a predicate is true.
term sizeReturns the terminal size
toTranslate structured data to a format
to csvConvert 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 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
to-csvSaves dataframe to csv file
to-dfConverts a List, Table or Dictionary into a dataframe
to-dummiesCreates a new dataframe with dummy variables
to-lazyConverts a dataframe into a lazy dataframe
to-lowercaseLowercase the strings in the column
to-nuConverts a section of the dataframe to Nushell Table
to-nuConvert expression to a nu value for access and exploration
to-parquetSaves dataframe to parquet file
to-uppercaseUppercase the strings in the column
touchCreates one or more files.
transposeTransposes the table contents so rows become columns and columns become rows.
tutorRun the tutorial. To begin, run: tutor
unaliasDeprecated command
uniqReturn the unique rows.
uniqueReturns unique values from a dataframe
updateUpdate an existing column to have a new value.
update cellsUpdate the table cells.
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
varAggregates columns to their var value
varCreate a var expression for an aggregation
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
whereFilter 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