从其他 Shell 或 DSL 到 Nu

这个表格背后的想法是帮助你了解 Nu 的内置和插件所提供命令与其他已知的 Shell 和特定领域语言(DSL)的关系。我们试图制作一张所有 Nu 命令和它们在其他语言中的对应关系的表。欢迎大家参与贡献。

注意:此表针对 Nu 0.43 或更高版本。

NushellSQL.Net LINQ (C#)PowerShell (without external modules)Bash
alias--aliasalias
append-Append-Append
args--
autoview--
math avgavgAverageMeasure-Object, measure
calc, <math expression>math operatorsAggregate, Average, Count, Max, Min, Sumbc
cd--Set-Location, cdcd
clear--Clear-Hostclear
compact
config--$Profilevi .bashrc, .profile
countcountCountMeasure-Object, measurewc
cp--Copy-Item, cp, copycp
dateNOW() / getdate()DateTime classGet-Datedate
debug
default
drop
du--du
eachcursorForEach-Object, foreach, for
echoprint, union all-Write-Output, writeecho
enter--
exit-exitexit
fetch-HttpClient,WebClient, HttpWebRequest/ResponseInvoke-WebRequestwget
firsttop, limitFirst, FirstOrDefaultSelect-Object -Firsthead
formatString.FormatString.Format
fromimport flatfile, openjson, cast(variable as xml)-Import/ConvertFrom-{Csv,Xml,Html,Json}
getSelect(cmd).column
group-bygroup byGroupBy, groupGroup-Object, group
headers
helpsp_help-Get-Help, help, manman
histogram--
history--Get-History, historyhistory
inc()---
is_emptyis nullString.InNullOrEmptyString.InNullOrEmpty
keep, =taketop, limitTakeSelect-Object -Firsthead
keep-until
keep-whileTakeWhile
kill--Stop-Process, killkill
lastLast, LastOrDefaultSelect-Object -Lasttail
lines--File.ReadAllLines
ls--Get-ChildItem, dir, lsls
match()case whenRegex.IsMatch[regex]
merge
mkdir--mkdir, mdmkdir
mv--Move-Item, mv, move, mimv
next
nthlimit x offset y, rownumber =ElementAt[x], indexing operator, ElementAt
openGet-Content, gc, cat, typecat
parse
transposepivot-
post()-HttpClient,WebClient, HttpWebRequest/ResponseInvoke-WebRequest
prepend
prev
ps()--Get-Process, ps, gpsps
pwd--Get-Location, pwdpwd
rangeRange1..10, ‘a’..’f’
reduceAggregate
reject
rename--Rename-Item, ren, rnimv
reverseReverse[Array]::Reverse($var)
rm--Remove-Item, del, erase, rd, ri, rm, rmdirrm
save--Write-Output, Out-File> foo.txt
selectselectSelectSelect-Object, select
shells---
shuffleRandomSort-Object {Get-Random}-
sizeMeasure-Object, measurewc
skipwhere row_number()SkipSelect-Object -Skip
skip until
skip whileSkipWhile
sort-byorder byOrderBy, OrderByDescending, ThenBy, ThenByDescendingSort-Object, sort
split-bySplitSplit
split column-
split row-
str()string functionsString classString class
str collectconcat_wsJoinJoin-String
str trimrtrim, ltrimTrim, TrimStart, TrimEndTrim
sumsumSumMeasure-Object, measure
sys()--Get-ComputerInfouname, lshw, lsblk, lscpu, lsusb, hdparam, free
tableFormat-Table, ft, Format-List, fl
tags---
textview()--Get-Content, cat
tree()--tree
to--Export/ConvertTo-{Csv,Xml,Html,Json}
touch--Set-Contenttouch
uniqdistinctDistinctGet-Unique, guuniq
upsertAs-
versionselect @@version-$PSVersionTable
with_env--$env:FOO = ‘bar’export foo = “bar”
wherewhereWhereWhere-Object, where, “?” operator
which---which
wrap
  • * - 这些命令是标准插件的一部分