今天我要給你們介紹一個生產力工具(裝逼神器)Shell,它叫Nushell,它是用Rust寫的,安全性提升的同時,Bug率也下降了。linux
NuShell 專一於實現如下目標:git
建立具備現代感的靈活的跨平臺Shellgithub
容許你將命令行應用程序與可理解數據結構的Shell進行混合和匹配shell
具備現代命令行應用程序提供的用戶體驗優化api
目前,NuShell 已經在Github上標星13.9K,累計分支631(詳情:https://github.com/nushell/nushell)安全
在 Linux / macOS 系統上運行 NuShell 的最簡單快捷的方法是從crates.io安裝 ,或從咱們的Github 發佈頁面下載預構建的二進制文件 。數據結構
對於任何 Linux 發行版來講,最理想的安裝方法是二進制方法。咱們將使用 curl 工具獲取最新版本,下載而後解壓縮文件以得到 Nushell 二進制文件。curl
sudo apt update sudo apt install pkg-config libssl-dev -y sudo apt install libxcb-composite0-dev libx11-dev -y
sudo yum install libxcb openssl-devel libX11-devel -y
brew install openssl cmake
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 -
tar -xvf nu_*_linux.tar.gz
sudo mv nu_*_linux/nushell-*/nu /usr/local/bin
Nushell將在啓動時在您的 PATH中查找插件。雖然Nushell在沒有它們的狀況下會有一些功能,但要得到完整的功能,你須要將它們複製到您的路徑中,以便加載它們。ide
sudo mv nu_*_linux/nushell-*/nu_plugin* /usr/local/bin
sudo dnf copr enable atim/nushell -y && sudo dnf install nushell -y
$ brew install nushell
在 macOS 系統上運行如下命令來下載 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 nu_*_macOS.zip
sudo mv nu_*_macOS/nushell-*/nu /usr/local/bin
sudo mv nu_*_macOS/nushell-*/nu_plugin* /usr/local/bin
建立一個名爲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
將用戶默認 shell 設置爲 Nu:
sudo chsh -s /usr/local/bin/nu techviewleo
切換到建立的用戶賬戶:
$ su - techviewleo Password: Welcome to Nushell 0.28.0 (type 'help' for more info) /home/techviewleo>
測試 ls 命令在 Nushell 中的工做方式:
$ su - techviewleo Password: Welcome to Nushell 0.28.0 (type 'help' for more info) /home/techviewleo>
最後附上nushell地址:https://github.com/nushell/nushell