A while ago, we posted some good alternatives to Linux man pages. Those tools skips all theoretical part and gives concise Linux command examples. If you are a lazy Linux user who wants some practical examples for a Linux command, they would definitely help. Today, we will see a similar tool named Navi. Navi is an interactive commandline cheatsheet tool written in Rust. Just like Bro pages, Cheat, Tldr tools, Navi also provides a list of examples for a given command, skipping all other comprehensive text parts.
Install Navi In Linux
Since Navi is written in Rust, you need to install Rust on your Linux box. To install Rust programming language in Linux, refer this guide.
Also Navi requires fzf tool for interactive search.
After installing Rust and fzf,run the following one-liner command to install navi:
bash <(curl -sL https://raw.githubusercontent.com/denisidoro/navi/master/scripts/install)
A. Install Navi using Cargo
Alternatively, you can install navi using Cargo package manager:
$ cargo install navi
If you encountered with "linker
cc not found" error, install development tools and try again.
B. Install Navi from source
Git clone the Navi repository using command:
$ git clone https://github.com/denisidoro/navi ~/.navi
This command will clone the contents of Navi official github repository in a folder named navi in your $HOME directory.
Go to the navi directory:
$ cd ~/.navi
And, install it using command:
$ sudo make install
C. Install Navi using Linuxbrew
If you have Linuxbrew installed on your system, run the following command to install navi:
$ brew install denisidoro/tools/navi
D. Install Navi from Arch User Repository
$ yay -S navi
How to use Navi interactive commandline cheatsheet tool
To launch navi, do:
When you run navi for the time, you will see the following screen. By default, you will be suggested to download some cheatsheets. Use arrow keys to choose "Download default cheatsheets" option and hit enter to list the available cheatsheets.
Here is the list of available cheatsheets. You can preview the list of available command snippets in the selected cheetsheet on the right pane.
Choose the cheatsheet from the list and hit ENTER key to download it.
All downloaded cheatsheets are available in /home/<user>/.local/share/navi/cheats.
When you run navi again, you will see the downloaded cheatsheets.
Use UP/DOWN arrow keys to go through the commands in the cheatsheet or type a few letters to find the matched command. To run any command, simply choose it from the list and hit ENTER. The selected command will run instantly. No need to type the full command! Just choose it and hit ENTER!!
Press ESC key to exit without running any command.
Print commands without executing
If you want to print the commands without running it, use print option.
$ navi --print
This command will print the selected command snippet in your Terminal window, but will not execute it.
Search commands matching to a pattern
To list command matched to a specific string, for example "apt", simply run:
$ navi query apt
There is also another option called "best" that autoselects the snippet that best matches the query.
$ navi best apt
To import cheatsheets from the available online repositories, run:
$ navi repo browse
The list of available repositories will appear. Choose any one from the list and hit ENTER to import the cheatsheets from the selected repository.
Run the above command again to download all available cheatsheets from other repositories.
In addition, you can import cheatsheets from any git repository like below:
$ navi repo add https://github.com/denisidoro/navi
When run Navi again, the newly imported cheatsheets will appear:
$ navi --help
- How To Create And Maintain Your Own Man Pages
- Learn To Use Man Pages Efficiently
- How To Install Missing Man Pages Of Commands On Ubuntu
- Pinfo – A CLI Program To Read Info And Man Pages In Color
- ExplainShell – Find What Each Part Of A Linux Command does
- Dwww – View Complete Debian Documentation Offline Via Web Browser
Hope this helps.