New commands for Linux

Have you ever been looking for something, but the exact name is not known? Use fussy logic! Tiered of doing ls-cd, ls-cd all day, use fzy. Now you can us it to look for a directory and open it directly and easily. Needing an intuitive du, use dust. Cheat for cheat sheets.

New commands for Linux
Photo by Codioful (Formerly Gradienta) / Unsplash

Some commands have changed and some are worth to download.

fzy

replace the ls — cd loop
Upgrade your ls — cd -command combo with fuzzy logic and ease of use. This is a spinoff from my tool series on fzf. And it is great! Add fzy and your set of aliases, and you are good to go. Benefits :

  • look for a directory with fuzzy logic
  • open it directly when it's found
  • no more ls-cd loops!

Install on macOS

brew install fzy

Install on Debian/Ubuntu

nala install fzy or apt update && apt-get install fzy 

Install on any system, see GitHub.

Alias example

fzycd='cd $(find -type d | fzy)'

Find a directory and open it. Just tape the name you think it is, and fzycd do the rest.


Cheat

cheat allows you to create and view interactive cheat sheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.

Install

cd /tmp \
  && wget https://github.com/cheat/cheat/releases/download/4.4.2/cheat-linux-amd64.gz \
  && gunzip cheat-linux-amd64.gz \
  && chmod +x cheat-linux-amd64 \
  && sudo mv cheat-linux-amd64 /usr/local/bin/cheat

Run it and accept to create a config file and download the community cheat sheets.

Additionally, cheat supports enhanced autocompletion via integration with fzf. To enable fzf integration:

  1. Ensure that fzf is available on your $PATH
  2. Set an env var: export CHEAT_USE_FZF=true

The project need some help to create new cheat sheets, newest are 2 years old and many are still missing. Feel free to join in.


Dust the new du

Are you tired of using du? Use dust — a much better and more intuitive output. If you want an easy way to see where your disk is being used.

Dust install: download the package du-dust_0.9.0-1_amd64.deb and install

Example

Nala

A modern and powerful frontend to apt. In short, Nala is a libapt-pkg frontend. Parallel Downloads are the most compelling argument to choose nala over APT. Also, the commands nala fetch, fetch the fastest mirror and nala history, package management history, are great.

/imgs/nala-update.png

Install on Ubuntu 22.04

Using apt: sudo apt update && sudo apt install nala

Newest version

Steps to get newer version, apt is at 0.11.1 current version is 0.15.1.
echo "deb-src https://deb.volian.org/volian/ scar main" | sudo tee -a /etc/apt/sources.list.d/volian-archive-scar-unstable.list

wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null

Download the package nala_0.15.1_all.deb from here.

BAT

The modern cat clone with wings

Install

Using apt: nala install bat on Ubuntu, it's batcat not the normal bat.

Latest version (Ubuntu)

Download the package from here and install: sudo dpkg -i bat_0.24.0_amd64.deb # adapt version number and architecture.
This way, bat is bat on Ubuntu. Debian and macOS are on 0.24.0

Eza — a modern replacement for ls

You list files hundreds of times a day. Why spend your time squinting at black and white text? eza is a modern, maintained replacement for the venerable file-listing command-line program ls that ships with Unix and Linux operating systems, giving it more features and better defaults. It uses colors and even icons to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary.

Eza, is replacing the now unsupported exa. Please uninstall exa first.

sudo rm -f /usr/local/bin/exa
sudo ln -s /usr/local/bin/eza /usr/local/bin/exa

Or sudo nala remove exa / sudo apt purge nala and create the symlink

A screenshot of exa with icons next to the file names.

Install

Download the package from here, open the tarball and move the executable to your path, e.g., /usr/local/bin. Apt is missing the latest security patch.

Debian/Ubuntu

wget -c https://github.com/eza-community/eza/releases/latest/download/eza_x86_64-unknown-linux-gnu.tar.gz -O - | tar xz
sudo chmod +x eza
sudo chown root:root eza
sudo mv eza /usr/local/bin/eza

On macOS

Install by brew install eza.


Old vs. New

  • man → cheat
  • ls → exa
  • cat → bat (bat -p) {On Debian batcat — Can't understand why}
  • ifconfig → ip a
  • route -n → ip route list
  • nslookup → dig
  • netstat -n --tcp --listen → ss --numeric --tcp --listen
  • apt-get → apt
  • apt → nala
  • pip → python3 -m pip
  • fgrep 'boss' /etc/passwd → grep -F 'boss' /etc/passwd
  • du → dust

References

bat [1] cheat [2] dust[3] eza (replaces exa) [4] fzy [5] fzf [6] nala [7]


  1. bat GitHub ↩︎

  2. cheat GitHub, cheat sheets page ↩︎

  3. dust GitHub ↩︎

  4. eza the newer replacement of exa GitHub,
    eza do replace the unsupported exa homepage, GitHub. ↩︎

  5. fzy manpage, GitHub ↩︎

  6. fzf GitHub ↩︎

  7. nala GitLab ↩︎