A shell in computing is a program with a command-line interface meant to allow human users to access the computer using commands. Thus, Nushell, also known as, nu, is a command-line shell, written in Rust programming language. Nu is available for Windows, macOS, and Linux operating systems. Nushell is an outstanding alternative shell to PowerShell and bash on Windows. Also, it is highly effective since Nu is a modern shell with a structured approach to your command line. As you use Nushell, you will realize that it simplifies command outputs with pipe and also comes with built-in commands. Hence, this guide will take through the installation and usage of the Nushell shell on both windows 10 and 11.
Features of Nushell shell
- Cross-Platform:Installed on macOS, Windows or Linux
- Table as output
- Supports sort and filter
- Fast and easy to use
Installation of Nushell on Windows 10/11 using winget
Nushell is a new shell that you would enjoy using on your computer to perform certain tasks. We will install Nu using a windows package manager by the name Winget. In most cases, Winget is preinstalled on Windows 10 and 11. So, let’s access Winget by running it using the command prompt.
Run command prompt as an administrator.
After the command prompt has opened, type the word winget. Winget commands will be displayed on the screen.
Go ahead and type winget install nushell command.
Winget will search for Nushell and display its version before the downloading starts.
Then Nushell will start downloading as shown below.
Nu shell will successfully get installed in your computer using winget.
Launching Nushell in Windows 11 / Windows 10
To start using Nushell on Windows 10/11, type “nu” on your computer’s search bar. Run Nushell as an administrator.
Here is the Nushell shell interface where you will enter commands of your choice.
Using Nushell Shell on Windows 11 / Windows 10
With Nushell, you can now start typing commands.
- List Command
Let’s start with the list command. It is written as ls as shown below. It displays a list of files in a tabular form.
Additionally, you can add an asterisk before ls to specify the files you want. For example, nushell can display the files that end with dll.
- Sort Command
From the same list of files, you can ask Nushell to sort the files according to size. Use the command ls | sort-by size | reverse to arrange the files in terms of size. Reserve means from the largest to the smallest.
Also, you can apply the ls | where size > 149mb command to ask Nushell to display the file whose size is 149 mbs as illustrated below.
- Processes Command
It is possible to view the current processes that are running on your computer by running the ps command. This command shows the status, name, memory, and CPU load for the processes.
Let’s go ahead and sort processes using memory. Use ps | where mem > 66mb command. Nushell will display the programs with 66 mbs and above.
- Date Command
By typing the word,date now, the specific day, month, year, and time will be displayed by Nushell shell.
In Nushell shell, Date can be displayed in a table by typing date now | date to-table.
- System Command
Use the command sys to get information about the host that Nu is running on.
Use sys | get host to see the host information. In this case, Nushell is running on Windows 10 operating system.
Configuring Nushell Shell on Windows 11 / Windows 10
Use the config path command to find where the configurations are stored.
To perform configurations on Nushell shell, type config command.
Other commands on Config:
- Line Editor Command
For instance, you can set vi mode, a mode for line editing using config set line_editor.edit_mode “vi”
- Start-up Command
In Nushell shell, you can set a phrase that will appear every time you open the command line.
Use config set startup [“echo ‘BEGIN'”]
You can now close Nushell and open it as an administrator.
The start-up NAME will appear as shown below.
If you want to clear the configurations, type config clear. All the configurations will be cleared when you hit on the ENTER button.
Usage Example on Nushell shell
You can perform basic mathematics using Nushell on Windows 10/11. Use add, subtract, multiply or divide with these operations +,-,*, and /.
Type 1 + 2 on Nu and press on ENTER.This is our simple example whose answer is 3
Following the order of operations starting the one with high precedence, Nushell performs mathematical operations according to the digits you enter.() starts, then *,/ followed by + and -.
Type 5 * (4 + 2) on Nu shell and hit enter button.
The answer is 30
As we wrap up, Nushell is a user-friendly and modern shell that you should try out. It has an exceptional interface; with data well arranged in tables. Use this article to get excellent information on how to install and use the Nushell shell on Windows 10 /11. You can leave a comment in case you face challenges.
Other guides include: