A data-oriented shell
Filesystem Data as Tables
The ls
command in Nushell returns a table of files with columns such as name, type, size, and modified timestamp, rather than a simple text listing. This means you can query it directly. For example, you can list directories in the current folder sorted by last modified time (as shown in Figure 3) with
ls | where type == "dir" | sort-by modified | reverse

System Information as Structured Data
Commands such as ps
(process list) and sys
(system info) are built into Nushell and return structured data as well. For instance, ps
gives you a table of running processes (with columns for PID, name, CPU, memory, etc.). You could find the top memory-consuming process (see Figure 4) with
ps | sort-by mem | last 1

Opening and Parsing Structured Files
Nushell's open
command is a powerful way to bring data from files (or URLs) into Nushell's pipeline. It auto-detects file types including JSON, CSV, TOML, YAML, XML, Excel, SQLite, and more and parses them into tables or records [2]. For example, the table in Figure 5 is generated with
open stack.yaml

Buy this article as PDF
(incl. VAT)