If you’ve spent any time in a traditional shell, you’ve probably written something like this: ls -la | grep ".json" | awk '{print $9, $5}'. You pipe text through a series of commands, parsing strings at each step, hoping you’ve accounted for edge cases like filenames with spaces. It works, but it feels fragile. Nushell takes a fundamentally different approach.
Instead of treating everything as text streams, Nushell operates on structured data—tables, records, and lists. Commands return data you can filter, sort, and transform without wrestling with string parsing. After experimenting with it, I’ve found it changes how I think about shell workflows entirely.
What Is Nushell?
Nushell (or “Nu”) is a modern, cross-platform shell that works on Linux, macOS, Windows, and BSD. At its core, it’s built around one central idea: everything is data.
When you run a command in Nushell, you don’t get a wall of text—you get structured output. The ls command, for example, returns a table with columns for name, type, size, and modification date. You can then operate on that table using consistent commands like where, select, and sort-by.
Key characteristics of Nushell include:
- Structured data pipelines: Commands output tables, lists, and records that flow through pipelines
- Type awareness: Nushell understands data types and catches errors that traditional shells miss
- Native format support: Built-in parsing for JSON, YAML, CSV, TOML, SQLite, and even Excel files
- Helpful error messages: When something goes wrong, Nu tells you exactly where and why
- Extensible plugin system: Easy to extend with custom commands and functionality
What Nushell Is NOT
Before diving into examples, it’s important to set clear expectations. Nushell makes intentional design decisions that differentiate it from traditional shells.
Not a Bash Drop-In Replacement
Nushell has its own syntax and philosophy. Commands you’ve memorized in bash won’t always work the same way—or at all. For example, command substitution uses a different syntax, and many bash-isms like && and || for command chaining work differently.
This is intentional. Nushell isn’t trying to maintain backward compatibility with decades of shell conventions. It’s rethinking what a shell should be in an era where we frequently work with structured data formats like JSON and YAML.
Not POSIX-Compliant
Your existing shell scripts won’t run in Nushell without modification. If you have hundreds of bash scripts powering your infrastructure, Nushell isn’t meant to replace them directly. You can still call those scripts from Nushell, but Nu itself doesn’t interpret POSIX shell syntax.
This trade-off is what enables Nushell’s more consistent and powerful data handling. POSIX compliance would require compromises that conflict with Nu’s core design.
Not Trying to Replace Python or Ruby
While Nushell has scripting capabilities and you can write custom commands, it’s still fundamentally a shell. It excels at command-line workflows, data exploration, and system interaction. For complex applications, business logic, or anything requiring extensive libraries, you’ll still want a general-purpose programming language.
Think of Nushell as a powerful glue layer—ideal for connecting tools, transforming data between formats, and interactive exploration—not as a replacement for your application code.
Cool Things Nushell Can Do
Now for the fun part. Here are some practical examples that showcase Nushell’s strengths.
Structured Output from Commands
In Nushell, basic commands return structured data you can immediately work with:
# List files and filter to show only files larger than 1MB
ls | where size > 1mb
# Sort files by modification date, newest first
ls | sort-by modified --reverse
# Show only specific columns
ls | select name size modified
Compare this to the bash equivalent where you’d need to parse ls -la output, handle varying column positions, and deal with date format inconsistencies.
Working with JSON and YAML
Nushell shines when working with structured file formats. There’s no need for jq or other external tools:
# Parse a JSON file and filter its contents
open package.json | get dependencies
# Query specific fields from a YAML config
open config.yaml | get database.connection_string
# Fetch JSON from an API and process it
http get https://api.github.com/users/nushell/repos | where stargazers_count > 100 | select name stargazers_count
The open command automatically detects file formats and parses them into structured data. You can then navigate into nested structures using get and apply the same filtering and selection commands you’d use on any table.
Data Pipelines
Building data pipelines in Nushell feels natural. You can chain operations together to transform data step by step:
# Find the 5 largest log files modified in the last week
ls **/*.log
| where modified > (date now | date add -1wk)
| sort-by size --reverse
| first 5
# Group files by extension and count them
ls | group-by { get name | path parse | get extension } | transpose extension count
# Calculate total size of files by type
ls | group-by type | each { |group| { type: $group.name, total: ($group.items.size | math sum) } }
Each step in the pipeline operates on structured data, making it easy to understand what’s happening and to add or modify steps.
Converting Between Formats
Need to convert data between formats? Nushell makes this trivial:
# Convert CSV to JSON
open data.csv | to json | save data.json
# Convert JSON to YAML
open config.json | to yaml
# Export a filtered table to CSV
ls | where type == "file" | select name size | to csv | save files.csv
This is incredibly useful for quick data transformations, preparing data for different tools, or exploring data in a more readable format.
Getting Started
Installing Nushell is straightforward. On macOS or Linux, you can use Homebrew:
brew install nushell
On Windows, use winget:
winget install nushell
After installation, launch Nu by typing nu in your current shell. You don’t have to commit to it as your default shell right away—you can try it interactively and return to your normal shell by typing exit.
A few commands to try first:
ls– See structured file listingssys– View system information as structured datahelp commands– Browse available commandsopen some-file.json– Parse and explore a JSON file
Key Takeaways
Nushell represents a different way of thinking about shell interaction. Instead of treating everything as text to be parsed, it embraces structured data as a first-class concept.
It’s worth considering if you:
- Frequently work with JSON, YAML, CSV, or other structured formats
- Find yourself writing complex
awk,sed, orjqpipelines - Want consistent behavior across different operating systems
- Value clear error messages and type safety in your shell work
It may not be the right fit if you:
- Need to maintain compatibility with existing POSIX shell scripts
- Prefer the familiarity of bash/zsh syntax
- Work in environments where you can’t install additional tools
My recommendation: try running Nushell alongside your current shell for a week. Use it for data exploration and one-off transformations. You might find, as I did, that certain tasks become dramatically simpler when you stop fighting with text parsing and start working with structured data.