Recommend a Shell force artifact, which has been open source! Netizen: really fragrant...

Posted by gple on Tue, 25 Jan 2022 11:59:22 +0100

Hello, I'm Jacko.

Today, I'd like to introduce a productivity tool (force artifact) Shell. It's called NuShell. It's written in Rust. While the security is improved, the Bug rate is also reduced. NuShell focuses on achieving the following goals:

  • Create a modern and flexible cross platform Shell
  • Allows you to mix and match command-line applications with shells that understand data structures
  • With user experience optimization provided by modern command-line applications

At present, NuShell has marked 13.9K on Github and accumulated 631 branches (details: github.com/nushell/nushell)

The easiest and quickest way to run NuShell on Linux / macOS is from Crites IO installation, or download pre built binaries from our Github release page.

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

Install developer tools

Ubuntu / Debian:

sudo apt updatesudo apt install pkg-config libssl-dev -ysudo 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

Installing Nushell on Linux

Download the latest binary Archive:

cd /tmpcurl -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 binaries to your PATH:

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

Nushell will look for plug-ins in your PATH at startup. Although nushell has some functionality without them, to get full functionality, you need to copy them to your PATH in order to load them.

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

Installing Nushell on macOS

For binary installation methods, use brew:

$ brew install nushell

Install manually from binaries

Run the following command on the macOS system to download the latest version of Nushell:

cd /tmpcurl -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 binaries to your PATH:

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

Copy Nu plug-in:

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

Run Nushell in Docker

If you are a windows user, it is recommended that you run the experience directly in Docker. A few commands are done. The commands are as follows:

docker run -it quay.io/nushell/nu:latest

Set user Shell to Nushell

Create a new user named techviewleo:

$ sudo adduser techviewleoAdding 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 successfullyChanging the user information for techviewleoEnter the new value, or press ENTER for the defaultFull 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

Switch to the user account you created:

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

Test how the ls command works in Nushell:

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

Operation effect display:

Finally, attach nushell address:

https://github.com/nushell/nushell