Install and use Nu Shell Apple system on Linux

You can download this article in PDF format via the link below to support us.
Download the guide in PDF formatshut down

Welcome to our guide on installing Nu Shell on Linux | macOS system. The goal of the Nushell project is to adopt the Unix shell concept, that is, pipes connect simple commands together and bring them into modern development style. Nu Shell is committed to achieving the following goals:

  • Create the most flexible, cross-platform shell with a modern feel.
  • Enables you to mix and match command-line applications using a shell that understands the structure of various data types
  • A shell with a certain degree of UX polish provided by modern CLI applications

The easiest and fastest way to run Nu Shell on Linux/macOS systems is to install from the following location crates.io, Or download the pre-built binary file from our website Github release page.

For any Linux distribution, the ideal installation method is the binary method. We will use the curl tool to get the latest version, download and unzip the file to get the Nushell binary file.

Step 1: Install developer tools

Developer tools required for installation:

Ubuntu / Debian:

sudo apt update
sudo apt install pkg-config libssl-dev -y
sudo apt install libxcb-composite0-dev libx11-dev -y

RHEL-based system:

sudo yum install libxcb openssl-devel libX11-devel -y

Apple system:

brew install openssl cmake

Step 2: Install Nushell on Linux

Download the latest binary archive file:

cd /tmp
curl -s  https://api.github.com/repos/nushell/nushell/releases/latest | grep browser_download_url |  cut -d '"' -f 4 | grep 'linux.tar.gz' | wget -i -

Unzip the downloaded file:

tar -xvf nu_*_linux.tar.gz

copy nu Binary files to your PATH:

sudo mv nu_*_linux/nushell-*/nu /usr/local/bin

Nu will look for plugins in your PATH at startup. Although nu has some functions without them, to get all the functions, you need to copy them to the path so that they can be loaded.

sudo mv nu_*_linux/nushell-*/nu_plugin* /usr/local/bin

Fedora users can use COPR repurchase Install Nushell:

sudo dnf copr enable atim/nushell -y && sudo dnf install nushell -y

Step 3: Install Nushell on macOS

For the binary installation method, use brew:

$ brew install nushell

Install manually from binary

On macOS, run the following command to download the latest version of Nushell:

cd /tmp
curl -s  https://api.github.com/repos/nushell/nushell/releases/latest | grep browser_download_url |  cut -d '"' -f 4 | grep 'macOS.zip' | wget -i -

Unzip the downloaded file:

unzip nu_*_macOS.zip

copy nu Binary files to your PATH:

sudo mv nu_*_macOS/nushell-*/nu /usr/local/bin

Also copy the Nu plugin:

sudo mv nu_*_macOS/nushell-*/nu_plugin* /usr/local/bin

Step 4: Set the user shell to Nushell

We will create a new user named techviewleo

$ sudo adduser techviewleo
Adding user `techviewleo' ...
Adding new group `techviewleo' (1000) ...
Adding new user `techviewleo' (1000) with group `techviewleo' ...
Creating home directory `/home/techviewleo' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for techviewleo
Enter the new value, or press ENTER for the default
	Full Name []:
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n] y

Set the user’s default shell to Nu:

sudo chsh -s /usr/local/bin/nu techviewleo

Confirm user shell:

$ getent passwd techviewleo
techviewleo:x:1000:1000:,,,:/home/techviewleo:/usr/local/bin/nu

Switch to the created user account:

$ su - techviewleo
Password:
Welcome to Nushell 0.28.0 (type 'help' for more info)
/home/techviewleo>

Test how the ls command works in Nushell:

$ home/techviewleo> ls /tmp/
───┬────────────────────────────────────────────────────────────────────────────────────────┬──────┬────────┬────────────
 # │                                          name                                          │ type │  size  │  modified
───┼────────────────────────────────────────────────────────────────────────────────────────┼──────┼────────┼────────────
 0 │ /tmp/snap.lxd                                                                          │ Dir  │ 4.1 KB │ 2 days ago
 1 │ /tmp/systemd-private-15969aaa8a724354bff192a746aaa953-systemd-logind.service-ny7rmg    │ Dir  │ 4.1 KB │ 2 days ago
 2 │ /tmp/systemd-private-15969aaa8a724354bff192a746aaa953-systemd-resolved.service-QsdDqg  │ Dir  │ 4.1 KB │ 2 days ago
 3 │ /tmp/systemd-private-15969aaa8a724354bff192a746aaa953-systemd-timesyncd.service-OKOxKf │ Dir  │ 4.1 KB │ 2 days ago
───┴────────────────────────────────────────────────────────────────────────────────────────┴──────┴────────┴────────────

Command output on macOS:

/Users/jkmutai> cd Parallels/
/Users/jkmutai/Parallels> ls
───┬────────────────┬──────┬───────┬──────────────
 # │      name      │ type │ size  │   modified
───┼────────────────┼──────┼───────┼──────────────
 0 │ CentOS 8.pvm   │ Dir  │ 384 B │ 1 month ago
 1 │ Ubuntu.pvm     │ Dir  │ 480 B │ 2 weeks ago
 2 │ Windows 10.pvm │ Dir  │ 416 B │ 2 months ago
───┴────────────────┴──────┴───────┴──────────────

List only directories:

$ ls | where type == Dir

You can learn more about Nushell from the following website official document page.The best starting point is Nu Introduction.

Similar guides on Shell:

Tips for the best terminal shells for Zsh, Bash and Fish

Install posh-git on Windows-Git’s PowerShell environment

How to install Starship Shell Prompt for Bash/Zsh/Fish

You can download this article in PDF format via the link below to support us.
Download the guide in PDF formatshut down

Sidebar