Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Introduction
  • Installation
    • Default Shell
  • Getting Started
    • Quick Tour
    • Moving Around the System
    • Thinking in Nu
    • Nushell Cheat Sheet
  • Nu Fundamentals
    • Types of Data
    • Loading Data
    • Pipelines
    • Working with Strings
    • Working with Lists
    • Working with Records
    • Working with Tables
    • Navigating and Accessing Structured Data
    • Special Variables
  • Programming in Nu
    • Custom Commands
    • Aliases
    • Operators
    • Variables
    • Control Flow
    • Scripts
    • Modules
      • Using Modules
      • Creating Modules
    • Overlays
    • Sorting
    • Testing your Nushell Code
    • Best Practices
  • Nu as a Shell
    • Configuration
    • Environment
    • Stdout, Stderr, and Exit Codes
    • Running System (External) Commands
    • How to Configure 3rd Party Prompts
    • Directory Stack
    • Reedline, Nu's Line Editor
    • Custom Completions
    • Externs
    • Coloring and Theming in Nu
    • Hooks
    • Background Jobs
  • Coming to Nu
    • Coming from Bash
    • Coming from CMD.EXE
    • Nu map from other shells and domain specific languages
    • Nu Map from Imperative Languages
    • Nu Map from Functional Languages
    • Nushell operator map
  • Design Notes
    • How Nushell Code Gets Run
  • (Not So) Advanced
    • Standard Library (Preview)
    • Dataframes
    • Metadata
    • Creating Your Own Errors
    • Parallelism
    • Plugins
    • explore

Nu Map from Imperative Languages

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

Note: this table assumes Nu 0.94 or later.

NushellPythonKotlin (Java)C++Rust
appendlist.append, set.addaddpush_back, emplace_backpush, push_back
math avgstatistics.mean
math, Math OperatorsMath operatorsMath operatorsMath operatorsMath operators
cpshutil.copyfs::copy
datedatetime.date.todayjava.time.LocalDate.now
droplist[:-3]
du, ls --dushutil.disk_usage
each
for
forforforfor
exitexit()System.exit, kotlin.system.exitProcessexitexit
http geturllib.request.urlopen
firstlist[:x]List[0], peekvector[0], topVec[0]
formatformatformatformatformat!
fromcsv, json, sqlite3
getdict[\"key\"]Map[\"key\"]map[\"key\"]HashMap["key"], get, entry
group-byitertools.groupbygroupBygroup_by
headerskeys
helphelp()
insertdict[\"key\"] = valmap.insert({ 20, 130 })map.insert(\"key\", val)
is-emptyis None, is []isEmptyemptyis_empty
takelist[:x]&Vec[..x]
take untilitertools.takewhile
take whileitertools.takewhile
killos.kill
lastlist[-x:]&Vec[Vec.len()-1]
lengthlensize, lengthlengthlen
linessplit, splitlinessplitviews::splitsplit, split_whitespace, rsplit, lines
lsos.listdirfs::read_dir
matchmatchwhenmatch
mergedict.appendmap.extend
mkdiros.mkdirfs::create_dir
mvshutil.movefs::rename
getlist[x]List[x]vector[x]Vec[x]
openopen
transposezip(\*matrix)
http posturllib.request.urlopen
prependdeque.appendleft
printprintprintlnprintfprintln!
psos.listdir('/proc')
pwdos.getcwdenv::current_dir
range typerange.., until, downTo, stepiota..
reducefunctools.reducereducereducefold, rfold, scan
rejectdel
renamedict[\"key2\"] = dict.pop(\"key\")map.insert(\"key2\", map.remove(\"key\").unwrap())
reversereversed, list.reversereverse, reversed, asReversedreverserev
rmos.remove
saveio.TextIOWrapper.write
select{k:dict[k] for k in keys}
shufflerandom.shuffle
str stats
str length
length
lenlen
skiplist[x:]&Vec[x..], skip
skip untilitertools.dropwhile
skip whileitertools.dropwhileskip_while
sort-bysorted, list.sortsortedBy, sortedWith, Arrays.sort, Collections.sortsortsort
split rowstr.split{,lines}, re.splitsplitviews::splitsplit
strstr functionsString functionsString functions&str, String functions
str joinstr.joinjoinToStringjoin
str trimstrip, rstrip, lstriptrim, trimStart, trimEndRegextrim, trim*{start,end}, strip*{suffix,prefix}
math sumsumsumreducesum
toimport csv, json, sqlite3
touchopen(path, 'a').close()
uniqsetSetsetHashSet
upsertdict[\"key\"] = val
versionsys.version, sys.version_info
with-env
$env.FOO = "bar"
os.environ
wherefilterfilterfilterfilter
whichshutil.which
wrap{ "key" : val }
Edit this page on GitHub
Contributors: Carson Black, Ibraheem Ahmed, Jonathan Turner, Hristo Filaretov, CKingX, JT, fdncred, Aaron Christiansen, Justin Ma, Stefan Holderbach, Zhora Trush, Dan Davison, Leon, Filip Andersson, casually-blue, Heidar-An, Ian Manske, NotTheDr01ds, Hofer-Julian
Prev
Nu map from other shells and domain specific languages
Next
Nu Map from Functional Languages