I’ve spent plenty of time writing quick awk and sed one-liners just to grab a column from ps or filter files by size.
The problem is that traditional shells like Bash treat everything as text.
Every command has to read and interpret the output from the previous one, which can make scripts harder to read and easier to break.
That’s what I like about Nushell.
Instead of passing text between commands, it works with structured data, where files, processes, and other command outputs are treated like tables, so you can filter and search them directly.
The first time I tried a command like:
it immediately made sense.
It returned exactly the files I wanted without using regular expressions, counting columns, or worrying about filenames that contain spaces.
The command is easy to read and does exactly what it says.
In this guide, I’ll show you how to install Nushell on Debian-based and RHEL-based Linux distributions.
Then we’ll go through the commands you’ll use most often, including navigating structured output, searching files and processes, working with CSV and JSON data, and writing your first Nushell script.
Traditional shells like Bash, Zsh, and Fish treat everything as plain text.
For example, when you run ps, the output is just text.
If you want to find a specific process or extract a column, you usually end up using tools like grep, awk, or cut to parse that text.
Nushell works differently.
Instead of passing plain text between commands, it works with structured data, where commands return tables with named columns, so you can filter and query the data directly without worrying about column positions or text formatting.
For example, ps in Nushell returns a table with columns like pid, cpu, and mem, making it easy to filter the information you need.
This makes everyday tasks easier because:
Keep in mind that Nushell is not a drop-in replacement for Bash, because existing Bash scripts won’t run in Nushell without changes because it has its own scripting language and command syntax.
Nushell isn’t included in the default Ubuntu, Debian, or RHEL repositories.
To install it, you first need to add the official community-maintained Fury.io repository.
Once it’s added, you can install and update Nushell using your system’s package manager just like any other package
On Ubuntu/Debian, import the GPG key, add the repository, and update the package list:
On RHEL, Fedora, and Rocky Linux, create the repository file with:
After adding the repository, installing Nushell takes just one command.
If you don’t want to add a repository, you can also install Nushell using Homebrew (brew install nushell) or download a prebuilt binary from the GitHub releases page and place it somewhere in your PATH.
Start Nushell from your current shell by running:
Example output:
You’re now inside a Nushell session and your regular Bash shell is still running underneath, and you can return to it anytime by typing:
Let’s start with a familiar command:
Output:
Unlike Bash, the output is already displayed as a table with named columns.
Since Nushell understands this data, you can filter it directly without using grep or awk.
For example, to show only files larger than 10 MB, run:
Output:
Here’s what’s happening in this pipeline:
In Bash, doing the same thing usually means parsing the output of ls with tools like awk or grep and manually handling file sizes.
In Nushell, you simply filter the size column because the shell already understands what that data represents.
Nushell also makes it easy to work with running processes.
Instead of piping ps through multiple text-processing tools, you can filter and sort the data directly.
Example output:
Here’s what each command does:
One of Nushell’s most useful features is that it can read common data formats without extra tools.
Suppose you have a CSV file containing website traffic logs.
To count the number of 404 responses, run:
Example output:
Here’s what happens:
The same approach works with JSON files.
For example, to read a value from a configuration file:
Nushell scripts use the .nu extension.
Create a new script:
Add the following code:
Example output:
This script defines a function named check-disk that accepts a disk usage threshold as an integer.
It lists the mounted filesystems, filters those using more than the specified percentage of disk space, and displays only the filesystem, use%, and available columns.
You now have Nushell installed on Ubuntu, Debian, RHEL, Fedora, or Rocky Linux, and you’ve seen how it handles everyday shell tasks using structured data instead of plain text.
If you’re new to Nushell, start with simple commands like:
These examples give you a good feel for how Nushell works and how its structured pipelines differ from traditional shells.
Nushell isn’t meant to replace Bash in every situation, especially if you already have existing Bash scripts and workflows.
But for exploring data, filtering command output, and working with structured files, it’s a powerful tool that’s worth adding to your toolbox.
Give it a try for a few days and see how it fits into your workflow.
You may end up using Bash for scripting and system administration, while reaching for Nushell whenever you need to search, filter, or analyze structured data more easily.
herdr: A Terminal Tool for Managing Multiple AI Coding Agents
Flyline: Add Syntax Highlighting, Fuzzy Search, and AI to Bash
Coolify: Deploy Any Web App on Your Own Linux Server
How to Create HTTPS Local Domains for Your Projects
LocalSend – Local Network File Sharing Between Linux, Windows and Mac
Why Linux Powers Everything From Your Coffee Machine to Mars Rovers
iftop – A Real Time Linux Network Bandwidth Monitoring Tool
How to Monitor Linux Commands Executed by System Users in Real-time
How to Monitor Ubuntu Performance Using Netdata
All You Need To Know About Processes in Linux [Comprehensive Guide]
MTR – A Network Diagnostic Tool for Linux
How to Install LibreNMS Monitoring Tool on Debian 11/10
Linux zcat Command Examples for Newbies
How to Convert a /Home Directory to Partition in Linux
How to Create a Virtual HardDisk Volume Using a File in Linux
Different Ways to Create and Use Bash Aliases in Linux
How to Record and Replay Linux Terminal Sessions
How to Control Systemd Services on Remote Linux Server
10 Best API Gateways and Management Tools in 2024
10 Best Linux File and Disk Encryption Tools (2024)
6 Most Notable Open Source Centralized Log Management Tools
9 Best Microsoft Excel Alternatives for Linux
15 Best Kali Linux Web Penetration Testing Tools
25 Outstanding Backup Utilities for Linux Systems in 2024
—
**📚 Original Source:**
[Nushell: A Better Shell for Files, Processes, and JSON](https://www.tecmint.com/nushell-a-better-shell-for-files-processes-and-json/)
