Как да

Install and Use Nu Shell on Linux | macOS

Install and Use Nu Shell on Linux | macOS

Welcome to our guide on the installation of Nu Shell on Linux | macOS system. The goal of Nushell project is to take the Unix philosophy of shells, where pipes connect simple commands together, and bring it to the modern style of development. The Nu Shell focuses on achieving the following:

The easiest and quickest way to get Nu Shell running on a Linux / macOS system is to install from crates.io, or download pre-built binaries from our the Github releases page.

The most ideal installation method for any Linux distribution is the binary method. We'll use curl tool to get the latest release, download then extract the file to obtain the Nushell binary.

Step 1: Install Developer Tools

Install Developer tools required:

Ubuntu / Debian:

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

RHEL Based systems:

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


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 -

Extract the file downloaded:

tar -xvf nu_*_linux.tar.gz

Copy nu binary file to your PATH:

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

Nu will look for the plugins in your PATH on startup. While nu will have some functionality without them, for full functionality you'll need to copy them into your path so they can be loaded.

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

Fedora users can use COPR repo to install Nushell:

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

Step 3: Install Nushell on macOS

For binary installation method use brew:

$ brew install nushell

Manual installation from binaries

On macOS system run the commands below to download the latest release 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 -

Extract the file downloaded:

unzip nu_*_macOS.zip

Copy nu binary file to your PATH:

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

Copy Nu plugins as well:

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

Step 4: Set User Shell to Nushell

We'll create a new user called 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 user 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 ls commands 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 ───┴────────────────────────────────────────────────────────────────────────────────────────┴──────┴────────┴────────────

Commands 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 directories only:

$ ls | where type == Dir

You can learn more about the Nushell from the official documentation pages. The best starting point is introduction to Nu.

Similar guides on Shells:

Best Terminal Shell Prompts for Zsh, Bash and Fish

Install posh-git on Windows - PowerShell environment for Git

How To Install Starship Shell Prompt for Bash / Zsh / Fish

Как да инсталирате JFrog Artifactory на Ubuntu 20.04
JFrog Artifactory е едно от най-модерните приложения за управление на хранилища, които се интегрират безпроблемно с инструменти за непрекъсната интегр...
Най-добрите книги за изучаване и овладяване на FreeBSD
FreeBSD е операционна система, създадена да бъде бърза и сигурна, захранвайки съвременни сървъри, настолни компютри и вградени системи. Тази операцион...
SSH Mastery - Най-добрата книга за овладяване на OpenSSH, PuTTY, тунели
SSH (Secure Shell) е протокол, предназначен да улесни сигурната комуникация между системите в ненадеждни мрежи и през интернет. SSH работи в архитекту...