Command Reference

aliasAlias a command (with optional flags) to a new name.
allTest if every element of the input fulfills a predicate expression.
ansiOutput ANSI codes to change color and style of text.
ansi gradientAdd a color gradient (using ANSI color codes) to the given string.
ansi linkAdd a link (using OSC 8 escape sequence) to the given string.
ansi stripStrip ANSI escape sequences from a string.
anyTests if any element of the input fulfills a predicate expression.
appendAppend any number of rows to a table.
astPrint the abstract syntax tree (ast) for a pipeline.
bitsVarious commands for working with bits.
bits andPerforms bitwise and for ints.
bits notPerforms logical negation on each bit.
bits orPerforms bitwise or for ints.
bits rolBitwise rotate left for ints.
bits rorBitwise rotate right for ints.
bits shlBitwise shift left for ints.
bits shrBitwise shift right for ints.
bits xorPerforms bitwise xor for ints.
breakBreak a loop.
bytesVarious commands for working with byte data.
bytes addAdd specified bytes to the input.
bytes atGet bytes defined by a range.
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 the bytes in the pipeline.
bytes starts-withCheck if bytes starts with a pattern.
calDisplay a calendar.
cdChange directory.
charOutput special characters (e.g., 'newline').
clearClear the terminal.
collectCollect the stream and pass it to a block.
columnsGiven a record or table, produce a list of its columns' names.
commandlineView or modify the current command line input buffer.
compactCreates a table with non-empty rows.
completeCapture the outputs and exit code from an external piped in command in a nushell table.
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 and
constCreate a parse-time constant.
continueContinue a loop from the next iteration.
cpCopy files using uutils/coreutils cp.
dateDate-related commands.
date formatRemoved command: use `format date` instead.
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 record.
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.
debug infoView process memory info.
decodeDecode bytes into a string.
decode base64Base64 decode a value.
decode hexHex decode a value.
defDefine a custom command.
defaultSets a default row's column if missing.
describeDescribe the type and structure of the value(s) piped in.
detect columnsAttempt to automatically split text into multiple columns.
dfrOperate with data in a dataframe format.
dfr aggPerforms a series of aggregations from a group-by.
dfr agg-groupsCreates an agg_groups expression.
dfr all-falseReturns true if all values are false.
dfr all-trueReturns true if all values are true.
dfr appendAppends a new dataframe.
dfr arg-maxReturn index for max value in series.
dfr arg-minReturn index for min value in series.
dfr arg-sortReturns indexes for a sorted series.
dfr arg-trueReturns indexes where values are true.
dfr arg-uniqueReturns indexes for unique values.
dfr arg-whereCreates an expression that returns the arguments where expression is true.
dfr asCreates an alias expression.
dfr as-dateConverts string to date.
dfr as-datetimeConverts string to datetime.
dfr cacheCaches operations in a new LazyFrame.
dfr colCreates a named column expression.
dfr collectCollect lazy dataframe into eager dataframe.
dfr columnsShow dataframe columns.
dfr concat-strCreates a concat string expression.
dfr concatenateConcatenates strings with other array.
dfr containsChecks if a pattern is contained in a string.
dfr countCreates a count expression.
dfr count-nullCounts null values.
dfr cumulativeCumulative calculation for a series.
dfr datepartCreates an expression for capturing the specified datepart in a column.
dfr dropCreates a new dataframe by dropping the selected columns.
dfr drop-duplicatesDrops duplicate values in dataframe.
dfr drop-nullsDrops null values in dataframe.
dfr dtypesShow dataframe data types.
dfr dummiesCreates a new dataframe with dummy variables.
dfr explodeExplodes a dataframe or creates a explode expression.
dfr expr-notCreates a not expression.
dfr fetchCollects the lazyframe to the selected rows.
dfr fill-nanReplaces NaN values with the given expression.
dfr fill-nullReplaces NULL values with the given expression.
dfr filterFilter dataframe based in expression.
dfr filter-withFilters dataframe using a mask or expression as reference.
dfr firstShow only the first number of rows or create a first expression
dfr flattenAn alias for dfr explode.
dfr getCreates dataframe with the selected columns.
dfr get-dayGets day from date.
dfr get-hourGets hour from date.
dfr get-minuteGets minute from date.
dfr get-monthGets month from date.
dfr get-nanosecondGets nanosecond from date.
dfr get-ordinalGets ordinal from date.
dfr get-secondGets second from date.
dfr get-weekGets week from date.
dfr get-weekdayGets weekday from date.
dfr get-yearGets year from date.
dfr group-byCreates a group-by object that can be used for other aggregations.
dfr implodeAggregates a group to a Series.
dfr into-dfConverts a list, table or record into a dataframe.
dfr into-lazyConverts a dataframe into a lazy dataframe.
dfr into-nuConverts a dataframe or an expression into into nushell value for access and exploration.
dfr is-duplicatedCreates mask indicating duplicated values.
dfr is-inCreates an is-in expression.
dfr is-not-nullCreates mask where value is not null.
dfr is-nullCreates mask where value is null.
dfr is-uniqueCreates mask indicating unique values.
dfr joinJoins a lazy frame with other lazy frame.
dfr lastCreates new dataframe with tail rows or creates a last expression.
dfr litCreates a literal expression.
dfr lowercaseLowercase the strings in the column.
dfr lsLists stored dataframes.
dfr maxCreates a max expression or aggregates columns to their max value.
dfr meanCreates a mean expression for an aggregation or aggregates columns to their mean value.
dfr medianAggregates columns to their median value
dfr meltUnpivot a DataFrame from wide to long format.
dfr minCreates a min expression or aggregates columns to their min value.
dfr n-uniqueCounts unique values.
dfr notInverts boolean mask.
dfr openOpens CSV, JSON, JSON lines, arrow, avro, or parquet file to create dataframe.
dfr otherwiseCompletes a when expression.
dfr quantileAggregates the columns to the selected quantile.
dfr queryQuery dataframe using SQL. Note: The dataframe is always named 'df' in your query's from clause.
dfr renameRename a dataframe column.
dfr replaceReplace the leftmost (sub)string by a regex pattern.
dfr replace-allReplace all (sub)strings by a regex pattern.
dfr reverseReverses the LazyFrame
dfr rollingRolling calculation for a series.
dfr sampleCreate sample dataframe.
dfr schemaShow schema for a dataframe.
dfr selectSelects columns from lazyframe.
dfr setSets value where given mask is true.
dfr set-with-idxSets value in the given index.
dfr shapeShows column and row size for a dataframe.
dfr shiftShifts the values by a given period.
dfr sliceCreates new dataframe from a slice of rows.
dfr sort-bySorts a lazy dataframe based on expression(s).
dfr stdCreates a std expression for an aggregation of std value from columns in a dataframe.
dfr str-lengthsGet lengths of all strings.
dfr str-sliceSlices the string from the start position until the selected length.
dfr strftimeFormats date based on string rule.
dfr sumCreates a sum expression for an aggregation or aggregates columns to their sum value.
dfr summaryFor a dataframe, produces descriptive statistics (summary statistics) for its numeric columns.
dfr takeCreates new dataframe using the given indices.
dfr to-arrowSaves dataframe to arrow file.
dfr to-avroSaves dataframe to avro file.
dfr to-csvSaves dataframe to CSV file.
dfr to-jsonlSaves dataframe to a JSON lines file.
dfr to-parquetSaves dataframe to parquet file.
dfr uniqueReturns unique values from a dataframe.
dfr uppercaseUppercase the strings in the column.
dfr value-countsReturns a dataframe with the counts for unique values in series.
dfr varCreate a var expression for an aggregation.
dfr whenCreates and modifies a when expression.
dfr with-columnAdds a series to the dataframe.
doRun a closure, providing it with the pipeline input.
dropRemove items/rows from the end of the input list/table. Counterpart of `skip`. Opposite of `last`.
drop columnRemove N columns at the right-hand end of the input table. To remove columns by name, use `reject`.
drop nthDrop the selected rows.
duFind disk usage sizes of specified items.
eachRun a closure on each row of the input list, creating a new list with the results.
each whileRun a block on each row of the input list until a null is found, then create a new list with the results.
echoReturns its arguments, ignoring the piped-in value.
encodeEncode a string into bytes.
encode base64Encode a string or binary value using Base64.
encode hexEncode a binary value using hex.
enterEnters a new shell at the given path.
enumerateEnumerate the elements in a stream.
error makeCreate an error.
everyShow (or skip) every n-th row, starting from the first one.
execExecute a command, replacing or exiting the current process, depending on platform.
exitExit Nu.
explainExplain closure contents.
exploreExplore acts as a table pager, just like `less` does for text.
exportExport definitions or environment variables from a module.
export aliasAlias a command (with optional flags) to a new name and export it from a module.
export constUse parse-time constant from a module and export them from this module.
export defDefine a custom command and export it from a module.
export externDefine an extern and export it from a module.
export moduleExport a custom module 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.
externDefine a signature for an external command.
fillFill and Align.
filterFilter values based on a predicate closure.
findSearches terms in the input.
firstReturn only the first several rows of the input. Counterpart of `last`. Opposite of `skip`.
flattenFlatten the table.
fmtFormat a number.
forLoop over a range.
formatVarious commands for formatting data.
format dateFormat a given date using a format string.
format durationOutputs duration with a specified unit of time.
format filesizeConverts a column of filesizes to some specified format.
format patternFormat columns into a string using a simple pattern.
fromParse a string or binary data into structured data.
from csvParse text as .csv and create table.
from emlParse text as .eml and create record.
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 record.
from tsvParse text as .tsv and create table.
from urlParse url-encoded string as a record.
from vcfParse text as .vcf and create table.
from xlsxParse binary Excel(.xlsx) data and create table.
from xmlParse text as .xml and create record.
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.
generateGenerate a list of values by successively invoking a closure.
getExtract data using a cell path.
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-bySplits a list or table into groups, and returns a record containing those groups.
gstatGet the git status of a repo
hashApply hash function.
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 different parts of Nushell.
help aliasesShow help on nushell aliases.
help commandsShow help on nushell commands.
help escapesShow help on nushell string escapes.
help externsShow help on nushell externs.
help modulesShow help on nushell modules.
help operatorsShow help on nushell operators.
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.
httpVarious commands for working with http methods.
http deleteDelete the specified resource.
http getFetch the contents from a URL.
http headGet the headers from a URL.
http optionsRequests permitted communication options for a given URL.
http patchPatch a body to a URL.
http postPost a body to a URL.
http putPut a body to a URL.
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.
input listInteractive list selection.
input listenListen for user interface event.
insertInsert a new column, using an expression or closure to create each row's values.
inspectInspect pipeline results while running a pipeline.
intoCommands to convert data from one type to another.
into binaryConvert value to a binary primitive.
into bitsConvert value to a binary primitive.
into boolConvert value to boolean.
into cell-pathConvert value to a cell-path.
into datetimeConvert text or timestamp into a datetime.
into durationConvert value to duration.
into filesizeConvert value to filesize.
into floatConvert data into floating point number.
into intConvert value to integer.
into recordConvert value to record.
into sqliteConvert table into a SQLite database.
into stringConvert value to string.
into valueInfer nushell datatype for each cell.
is-adminCheck if nushell is running with administrator or root privileges.
is-emptyCheck for empty values.
is-terminalCheck if stdin, stdout, or stderr is a terminal.
itemsGiven a record, iterate on each pair of column name and associated value.
joinJoin two tables.
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.
lastReturn only the last several rows of the input. Counterpart of `first`. Opposite of `drop`.
lazy makeCreate a lazy record.
lengthCount the number of items in an input list or rows in a table.
letCreate a variable and give it a value.
let-env`let-env FOO = ...` has been removed, use `$env.FOO = ...` instead.
linesConverts input to lines.
load-envLoads an environment update from a record.
loopRun a block in a loop.
lsList the filenames, sizes, and modification times of items in a directory.
matchConditionally run a block on a matched value.
mathUse mathematical functions as aggregate functions on a list of numbers or tables.
math absReturns the absolute value of a number.
math arccosReturns the arccosine of the number.
math arccoshReturns the inverse of the hyperbolic cosine function.
math arcsinReturns the arcsine of the number.
math arcsinhReturns the inverse of the hyperbolic sine function.
math arctanReturns the arctangent of the number.
math arctanhReturns the inverse of the hyperbolic tangent function.
math avgReturns the average of a list of numbers.
math ceilReturns the ceil of a number (smallest integer greater than or equal to that number).
math cosReturns the cosine of the number.
math coshReturns the hyperbolic cosine of the number.
math expReturns e raised to the power of x.
math floorReturns the floor of a number (largest integer less than or equal to that number).
math lnReturns the natural logarithm. Base: (math e).
math logReturns the logarithm for an arbitrary base.
math maxReturns the maximum of a list of values, or of columns in a table.
math medianComputes the median of a list of numbers.
math minFinds the minimum within a list of values or tables.
math modeReturns the most frequent element(s) from a list of numbers or tables.
math productReturns the product of a list of numbers or the products of each column of a table.
math roundReturns the input number rounded to the specified precision.
math sinReturns the sine of the number.
math sinhReturns the hyperbolic sine of the number.
math sqrtReturns the square root of the input number.
math stddevReturns the standard deviation of a list of numbers, or of each column in a table.
math sumReturns the sum of a list of numbers or of each column in a table.
math tanReturns the tangent of the number.
math tanhReturns the hyperbolic tangent of the number.
math varianceReturns the variance of a list of numbers or of each column in a table.
mergeMerge the input with a record or table, overwriting values in matching columns.
metadataGet the metadata for items in the stream.
mkdirMake directories, creates intermediary directories as required.
mktempCreate temporary files or directories using uutils/coreutils mktemp.
moduleDefine a custom module.
moveMove columns before or after other columns.
mutCreate a mutable variable and give it a value.
mvMove files or directories.
nSwitch to the next shell.
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').
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 closure on each row of the input list in parallel, creating a new list with the results.
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-toExpress 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.
prependPrepend any number of rows to a table.
printPrint the given values to stdout.
psView information about system processes.
queryShow all the query commands
query dbQuery a database using SQL.
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 diceGenerate a random dice roll.
random floatGenerate a random float within a range [min..max].
random intGenerate a random integer [min..max].
random uuidGenerate a random uuid4 string.
rangeReturn only the selected rows.
reduceAggregate a list to a single value using an accumulator closure.
registerRegister a plugin.
registry queryQuery the Windows registry.
rejectRemove the given columns or rows from the table. Opposite of `select`.
renameCreates a new table with columns renamed.
returnReturn early from a function.
reverseReverses the input list or table.
rmRemove files and directories.
rollRolling commands for tables.
roll downRoll table rows down.
roll leftRoll record or table columns left.
roll rightRoll table columns right.
roll upRoll table rows up.
rotateRotates a table or record clockwise (default) or counter-clockwise (use --ccw flag).
run-externalRuns external command.
saveSave a file.
schemaShow the schema of a SQLite database.
scopeCommands for getting info about what is in scope.
scope aliasesOutput info on the aliases in the current scope.
scope commandsOutput info on the commands in the current scope.
scope engine-statsOutput stats on the engine in the current state.
scope externsOutput info on the known externals in the current scope.
scope modulesOutput info on the modules in the current scope.
scope variablesOutput info on the variables in the current scope.
selectSelect only these columns or rows from the input. Opposite of `reject`.
seqOutput sequences of numbers.
seq charPrint a sequence of ASCII characters.
seq datePrint sequences of dates.
shellsLists all open shells.
shuffleShuffle rows randomly.
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.
sortSort in increasing order.
sort-bySort by the given columns, in increasing order.
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 into a list of characters.
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-bySplit a record into groups.
startOpen a folder, file or website in the default application or viewer.
storVarious commands for working with the in-memory sqlite database.
stor createCreate a table in the in-memory sqlite database.
stor deleteDelete a table or specified rows in the in-memory sqlite database.
stor exportExport the in-memory sqlite database to a sqlite database file.
stor importImport a sqlite database file into the in-memory sqlite database.
stor insertInsert information into a specified table in the in-memory sqlite database.
stor openOpens the in-memory sqlite database.
stor resetReset the in-memory database by dropping all tables.
stor updateUpdate information in a specified table in the in-memory sqlite database.
strVarious commands for working with string data.
str camel-caseConvert a string to camelCase.
str capitalizeCapitalize first letter of text.
str containsChecks if string input contains a substring.
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 escape-globEscape glob pattern.
str expandGenerates all possible combinations defined in brace expansion syntax.
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 pascal-caseConvert a string to PascalCase.
str replaceFind and replace text.
str reverseReverse every string in the pipeline.
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 statsGather word count statistics on the text.
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 trimTrim whitespace or specific character.
str upcaseMake text uppercase.
sysView information about the system.
tableRender the table.
takeTake only the first n elements of a list, or the first n bytes of a binary value.
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.
timeitTime the running time of a block.
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 record into .toml text.
to tsvConvert table into .tsv text.
to xmlConvert special record structure 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.
tryTry to run a block, if it fails optionally run a catch block.
tutorRun the tutorial. To begin, run: tutor.
ulimitSet or get resource usage limits.
umkdirCreate directories, with intermediary directories if required using uutils/coreutils mkdir.
umvMove files or directories.
uniqReturn the distinct values in the input.
uniq-byReturn the distinct values in the input by the given column(s).
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.
urlVarious commands for working with URLs.
url build-queryConverts record or table into query string applying percent-encoding.
url decodeConverts a percent-encoded web safe string to a string.
url encodeConverts a string to a percent encoded web safe string.
url joinConverts a record to url.
url parseParses a url.
useUse definitions from a module, making them available in your shell.
valuesGiven a record or table, produce a list of its columns' values.
versionDisplay Nu version, and its build configuration.
viewVarious commands for viewing debug information.
view filesView the files registered in nushell's EngineState memory.
view sourceView a block, module, or a definition.
view spanView the contents of a span.
watchWatch for file changes and execute Nu code when they happen.
whereFilter values based on a row condition.
whichFinds a program file, alias or custom command.
whileConditionally run a block in a loop.
whoamiGet the current username using uutils/coreutils whoami.
windowCreates a sliding window of `window_size` that slide by n rows/elements across input.
with-envRuns a block with an environment variable set.
wrapWrap the value into a column.
zipCombine a stream with the input.