Nu map from imperative languages

The idea behind this table is to help you understand how Nu built-ins and plug-ins relate to imperative languages. We’ve tried to produce a map of all the Nu commands and what their equivalents are in other languages. Contributions are welcome.

Note: this table assumes Nu 0.43 or later.

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
empty?is 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 collectstr.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
  • * - these commands are part of the standard plugins