从命令式语言到 Nu

这个表格的目的是帮助你了解 Nu 的内置和插件所提供的命令与命令式语言的关系。我们试图制作一张所有 Nu 命令和它们在其他语言中的对应关系的表。欢迎大家参与贡献。

注意:此表假设 Nu 0.43 或更高版本。

NushellPythonKotlin (Java)C++Rust
alias
appendlist.append, set.addaddpush_back, emplace_backpush, push_back
args
autoview
math avgstatistics.mean
calc, = mathmath operatorsmath operatorsmath operatorsmath operators
cd
clear
clip
compact
config
countlensize, lengthlengthlen
cpshutil.copy
datedatetime.date.todayjava.time.LocalDate.now
debug
default
drop
dushutil.disk_usage
eachforforforfor
echoprintprintlnprintfprintln!
enter
exitexitSystem.exit, kotlin.system.exitProcessexitexit
fetchurllib.request.urlopen
firstlist[0]List[0], peekvector[0], topVec[0]
formatformatformatformatformat!
fromcsv, json, sqlite3
getdict["key"]Map["key"]map["key"]HashMap["key"], get, entry
group-byitertools.groupbygroupBygroup_by
headers
helphelp
histogram
history
inc(*)x += 1x++x++x += 1
insertlist.insert
is-emptyis NoneisEmptyemptyis_empty
keeplist[:x]&Vec[..x]
keep until
keep whileitertools.takewhile
killos.kill
lastlist[-1]&Vec[Vec.len()-1]
linessplit, splitlinessplitviews::splitsplit, split_whitespace, rsplit, lines
lsos.listdir
match(*)re.findallRegex.matchesregex_match
merge
mkdiros.mkdir
mvshutil.move
next
nthlist[x]List[x]vector[x]Vec[x]
openopen
parse
transposezip(*matrix)
post(*)urllib.request.urlopen
prependdeque.appendleft
prev
ps(*)os.listdir('/proc')
pwdos.getcwd
rangerange.., until, downTo, stepiota..
reducefunctools.reducereducereducefold, rfold, scan
reject
renameshutil.move
reversereversed, list.reversereverse, reversed, asReversedreverserev
rmos.remove
saveio.TextIOWrapper.write
select{k:dict[k] for k in keylist}
shells
shufflerandom.shuffle
sizelen
skiplist[x:]&Vec[x..],skip
skip until
skip whileitertools.dropwhileskip_while
sort-bysorted, list.sortsortedBy, sortedWith, Arrays.sort, Collections.sortsortsort
split-bystr.split{,lines}, re.splitsplitviews::splitsplit
split column
split row
str(*)str functionsString functionsstring functions&str, String functions
str joinstr.joinjoinToStringjoin
str trimstrip, rstrip, lstriptrim, trimStart, trimEndregextrim, trim*{start,end}, strip*{suffix,prefix}
sumsumsumreducesum
sys(*)sys
table
tags
tree(*)
tocsv, json, sqlite3
touchopen(path, 'a').close()
uniqsetSetsetHashSet
upsert
versionsys.version, sys.version_info
with-envos.environ
wherefilterfilterfilterfilter
whichshutil.which
wrap
  • * - 这些命令是标准插件的一部分