命令索引

若要查看所有 Nushell 命令, 可以执行 help commands

译注:本页内容由于是从源码生成的暂不支持国际化,大家还是先看英文版的凑合下吧。

CommandDescription
aliasAlias a command (with optional flags) to a new name
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.
appendAppend any number of rows to a table.
benchmarkTime the running time of a block
build-stringCreate a string from the arguments.
calDisplay a calendar.
cdChange directory.
charOutput special characters (e.g., ‘newline’).
clearClear the terminal.
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
configEdit nushell configuration files
config envEdit nu environment configurations
config nuEdit nu configurations
cpCopy files.
dataframeDeprecated command
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.
describeDescribe the value(s) piped in.
detect columnsAttempt to automatically split text into multiple columns
dfrDataframe commands
dfr agg-groupscreates an agg_groups expression
dfr aggregatePerforms a series of aggregations from a group by
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 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 dataframe
dfr columnReturns the selected column
dfr concatenateConcatenates strings with other array
dfr containsChecks if a pattern is contained in a string
dfr count-nullCounts null values
dfr count-uniqueCounts unique values or creates a n-unique expression
dfr cumulativeCumulative calculation for a series
dfr describeDescribes dataframes numeric columns
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 explodecreates an explode expression
dfr fetchcollects the lazyframe to the selected rows
dfr fill-naReplaces NA values with the given expression
dfr fill-nullReplaces NULL values with the given expression
dfr filter-withFilters dataframe using a mask or expression as reference
dfr firstCreates new dataframe with first rows or creates a first expression
dfr flattencreates a flatten expression
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 groupby object that can be used for other aggregations
dfr is-duplicatedCreates mask indicating duplicated values
dfr is-inChecks if elements from a series are contained in right series
dfr is-not-nullCreates mask where value is not null or creates a is-not-null expression
dfr is-nullCreates mask where value is null or creates a is-null expression
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 listAggregates a group to a Series
dfr litCreates a literal expression
dfr lsLists stored dataframes
dfr maxAggregates columns to their max value or creates a max expression
dfr meanAggregates columns to their mean value or creates a mean expression
dfr medianAggregates columns to their median value or creates a median expression
dfr meltUnpivot a DataFrame from wide to long format
dfr minAggregates columns to their min value or creates a min expression
dfr notInverts boolean mask or creates a not expression
dfr openOpens csv, json or parquet file to create dataframe
dfr pivotPerforms a pivot operation on a groupby object
dfr quantileAggregates the columns to the selected quantile
dfr renameRenames a series
dfr rename-colRename 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 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 sortCreates new sorted dataframe or series
dfr sort-bysorts a lazy dataframe based on expression(s)
dfr stdAggregates columns to their std value
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 sumAggregates columns to their sum value or creates a sum expression
dfr takeCreates new dataframe using the given indices
dfr to-csvSaves dataframe to csv file
dfr to-dfConverts a List, Table or Dictionary into a dataframe
dfr to-dummiesCreates a new dataframe with dummy variables
dfr to-lazyConverts a dataframe into a lazy dataframe
dfr to-lowercaseLowercase the strings in the column
dfr to-nuConvert expression to a nu value for access and exploration
dfr to-parquetSaves dataframe to parquet file
dfr to-uppercaseUppercase the strings in the column
dfr uniqueReturns unique values from a series
dfr value-countsReturns a dataframe with the counts for unique values in series
dfr varAggregates columns to their var value
dfr whenCreates a when expression
dfr with-columnAdds a series to the dataframe
doRun a block
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.
duFind disk usage sizes of specified items.
eachRun a block on each element of input
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.
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
externDefine a signature for an external command
fetchFetch the contents from a URL.
findSearches terms in the input or for elements of the input that satisfies the predicate.
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.
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-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
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.
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
load-envLoads an environment update from a record.
lsList the files in a directory.
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
mergeMerge a table into an input table
metadataGet the metadata for items in the stream
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.
nthDeprecated command
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 addAdd definitions from a module as an overlay
overlay listList all active overlays
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.
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 values.
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’.
renameCreates a new table with columns renamed.
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
rotateRotates a table clockwise (default) or counter-clockwise (use —ccw flag).
run-externalRuns external command
saveSave a file.
selectDown-select table to only these columns.
seqPrint sequences of numbers.
seq charPrint sequence of chars
seq datePrint sequences of dates
shellsLists all open shells.
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.
sortSort in increasing order.
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.
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
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
sysView information about the system.
tableRender the table.
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
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.
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
versionDisplay Nu version.
view-sourceView a block, module, or a definition
watchWatch for file changes and execute Nu code when they happen.
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-envRuns a block with an environment variable set.
wrapWrap the value into a column.
zipCombine a stream with the input