Nu map from other shells and domain specific languages
The idea behind this table is to help you understand how Nu builtins and plugins relate to other known shells and domain specific languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome.
| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash |
|---|---|---|---|---|
alias | Set-Alias | alias | ||
append | Append | -Append | ||
math avg | avg | Average | Measure-Object -Average | |
Operators and math | Math operators | Aggregate, Average, Count, Max, Min, Sum | Measure-Object -Sum | bc |
cd | Set-Location, cd | cd | ||
clearCtrl/⌘+L | Clear-HostCtrl/⌘+L | clearCtrl/⌘+L | ||
config$nu.default-config-dir | $Profile | ~/.bashrc, ~/.profile | ||
cp | Copy-Item, cp, copy | cp | ||
date | NOW(), getdate() | DateTime class | Get-Date | date |
duls --du | Get-ChildItem -File -Recurse -Force | Measure-Object Length -Sum | du | ||
each | Cursors | ForEach-Object, foreach, for | for | |
exitCtrl/⌘+D | exitCtrl/⌘+D | exitCtrl/⌘+D | ||
http | HttpClient, WebClient, HttpWebRequest/Response | Invoke-WebRequest | wget, curl | |
first | top, limit | First, FirstOrDefault | Select-Object -First | head |
format, str | String.Format | <format> -f <values> | printf | |
from | import flatfile, openjson, cast(variable as xml) | Import/ConvertFrom-{Csv,Xml,Html,Json} | ||
get | Select | command | ForEach-Object <name> | ||
group-by | group by | GroupBy, group | Group-Object, group | |
help | sp_help | Get-Help, help, man | man | |
history | Get-History, history | history | ||
is-empty | is null | String.IsNullOrEmpty | [string]::IsNullOrEmpty | |
kill | Stop-Process, kill | kill | ||
last | Last, LastOrDefault | Select-Object -Last | tail | |
str statslengthstr length | count | Count | Measure-Object, measure | wc |
lines | File.ReadAllLines | Get-Content | ||
ls | Get-ChildItem, dir, ls | ls | ||
mkdir | mkdir, md, New-Item -ItemType Directory | mkdir | ||
mv | Move-Item, mv, move, mi | mv | ||
open | Get-Content, gc, cat, type | cat | ||
print | print, union all | Write-Output, write | echo, print | |
transpose | pivot | |||
ps | Get-Process, ps, gps | ps | ||
pwd | Get-Location, pwd | pwd | ||
range | Range | 1..10, 'a'..'f' | ||
reduce | Aggregate | |||
rename | Rename-Item, ren, rni | mv | ||
reverse | Reverse | [Array]::Reverse($var) | ||
rm | Remove-Item, del, erase, rd, ri, rm, rmdir | rm | ||
save | Out-File, > foo.txt | > foo.txt | ||
select | select | Select | Select-Object, select | |
shuffle | Random | Sort-Object {Get-Random} | ||
skip | where row_number() | Skip | Select-Object -Skip | |
skip until | SkipWhile | |||
skip while | SkipWhile | |||
slice | limit x offset y, rownumber | ElementAt | [x], indexing operator, ElementAt, Select-Object -Index | |
sort-by | order by | OrderBy, OrderByDescending, ThenBy, ThenByDescending | Sort-Object, sort | sort |
str | String functions | String class | String class | |
str join | concat_ws | Join | Join-String, <list> -join <sep> | |
str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | |
math sum | ``sum` | Sum | Measure-Object, measure | |
unamesys host | Get-ComputerInfo | uname | ||
sys disks | Get-Disk, Get-Partition, Get-Volume etc | lsblk | ||
sys mem | Get-ComputerInfo | free | ||
table | Format-Table, ft, Format-List, fl | |||
take | top, limit | Take | Select-Object -First | head |
take until | TakeWhile | |||
take while | TakeWhile | |||
timeit | Measure-Command | time | ||
to | Export/ConvertTo-{Csv,Xml,Html,Json} | |||
touch | New-Item | touch | ||
uniq | distinct | Distinct | Get-Unique, Sort-Object -Unique | uniq |
update | ||||
upsert | ||||
version | select @@version | $PSVersionTable | ||
$env.FOO = "bar"with-env | $env:FOO = 'bar' | export FOO "bar" | ||
where | where | Where | Where-Object, where, ? | |
which | Get-Command | which |