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
    • Coming from PowerShell
    • 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

Coming from PowerShell

Tips

PowerShell pipelines pass rich .NET objects, which allow property access like $process.Name or piping objects directly into cmdlets that understand them.

Nushell pipelines, by contrast, pass structured data such as tables, lists, and values.
This means:

  • No .PropertyName access
  • Use get column, select, $it.column, or table operations instead
  • Commands always receive predictable structured input, not strings or .NET types

Command Equivalents:

PowerShellNuTask
Get-ChildItemlsList files in current directory
Get-ChildItem <dir>ls <dir>List files in given directory
Get-ChildItem pattern*ls pattern*Pattern-match files
Get-ChildItem -Force -File -Hiddenls --long --all or ls -laDetailed listing including hidden files
Get-ChildItem | Where-Object { $_.PSIsContainer }ls | where type == dirList directories only
Get-ChildItem -Recurse -Filter *.rsls **/*.rsRecursive search for files
Get-ChildItem -Recurse Makefile | Select-Object -Expand Namels **/Makefile | get name | vim ...$inPass matched paths to command
Set-Location <dir>cd <dir>Change directory
Set-LocationcdGo to home directory
Set-Location -cd -Go to previous directory
New-Item -ItemType Directory <path>mkdir <path>Create a directory
New-Item test.txttouch test.txtCreate a file
command | Out-File <path>out> <path> or o> <path>Save output to file (raw)
command | Set-Content <path>| save <path>Save output to file (structured)
command | Out-File -Append <path>out>> <path> or o>> <path>Append output to file
| save --append <path>Append structured output
command | Out-Null| ignoreDiscard output
cmd1 | Tee-Object -FilePath log.txt | cmd2cmd1 | tee { save log.txt } | cmd2Tee output to file
command | Select-Object -First 5command | first 5Limit output to first N rows
Get-Content <path>open --raw <path>Display file contents
Move-Item <source> <dest>mv <source> <dest>Move file
Get-ChildItem *.md | ForEach-Object { $_.Name }ls *.md | each { $in.name }Iterate list values
foreach ($i in 1..10) { $i }for i in 1..10 { print $i }Loop over range
Copy-Item <source> <dest>cp <source> <dest>Copy file
Copy-Item -Recurse <source> <dest>cp -r <source> <dest>Copy directory recursively
Remove-Item <path>rm <path>Remove file
rm -t <path>Move file to trash
Remove-Item -Recurse -Force <path>rm -r <path>Remove directory recursively
Get-Date "<date>""<date>" | into datetime -f <format>Parse date
"<str>" -replace 'a','b'str replace "a" "b"Replace substrings
Select-String <pattern>where $it =~ <pattern> or find <pattern>Search text
Get-Help <command>help <command>Get command help
Get-Commandhelp commandsList all commands
Get-Command "*<string>*"help --find <string>Search commands
command1; if ($?) { command2 }command1; command2Run second command only if first succeeds
/tmp/$((Get-Random))$"/tmp/(random int)"String interpolation
$env:Path$env.PATH or $env.PathShow PATH
$LASTEXITCODE$env.LAST_EXIT_CODEExit code of last external command
$env:PATH += ":/usr/bin"$env.PATH = ($env.PATH | append /usr/bin)Update PATH (temporary)
Get-ChildItem Env:$envList environment variables
$env:FOO$env.FOOAccess environment variable
Remove-Item Env:FOOhide-env FOOUnset environment variable
Set-Alias s "git status -sb"alias s = git status -sbTemporary alias
Get-Command FOOwhich FOOInspect command / alias / binary
powershell -Command "<commands>"nu -c <commands>Run inline pipeline
.\script.ps1nu <script file>Run script file
Get-Location or $PWDpwd or $env.PWDShow current directory
Read-Hostlet var = inputRead user input
Read-Host -AsSecureStringlet secret = input -sRead secret input
Edit this page on GitHub
Contributors: luk3953
Prev
Coming from CMD.EXE
Next
Nu map from other shells and domain specific languages