Modern Alternatives to Classic Linux Tools

Modern Alternatives to Classic Linux Tools

  • bat is nicer cat with syntax highlighting

  • fd is a replacement for the old find and that’s not amazing

  • gping is ping with a graph, in Rust

  • delta is like diff tool but even more like a syntax-highlighting pager for git, diff, and grep output. Try delta -s one.txt two.txt.

  • dust better du command which is used to show sizes of subfolders and such. Not impressed by results.

  • broot is alternative to tree but with much more

  • exa is a modern ls, but still not on Windows, site here but much better is lsd-rs/lsd: The next gen ls command jer ima čak i Windows instalaciju preko scoop a ubuntu preko

  • procs modern replacement for ps written in Rust. Interesting procs --watch

  • lazygit is simple terminal UI for git commands

  • dive is amazing CLI tool for exploring each layer in a docker image

  • sharkdp/hyperfine is CLI benchmarking tool

Core Utils

uutils/coreutils is cross-platform Rust rewrite of the GNU coreutils

Improve cd command

These tools are alternatives to the cd command, designed to save you time by reducing the amount of typing you need to do.

The original tool, Autojump used j command, was written in Python, but has likely been unmaintained. Its impact was such, however, that it paved the way for the creation of others, like rupa/z and rupa/v, which are written in bash script. These tools have been so successful that they have been ported to other systems in various forms (fasd, z.lua, zsh-z, ZLocation).

  • ZLocation is native PowerShell module, successor of “Jump-Location”
  • z is also PowerShell, and not sure why I decided on to go with ZLocation
  • z.lua also works the same in Lua
  • zoxide is the most modern one, in Rust, and as such should be faster than others. Install on Windows as it needs more config to me invoked with simple z. So I’m not using it right now, but using ZLocation
  • fasd is archived now
  • Jump-Location is a Powershell implementation of autojump’s j command, but has a successor now

If you encounter an error while removing ZLocation, such as ERROR Couldn't remove ... it may be in use., first uninstall it once, and when it fails, close the entire Terminal, then open a new Powershell and try again with the purge option. That would do it.

Trying zoxide, but must add govno: Invoke-Expression (zoxide init --hook prompt powershell | Out-String) zi is Z interactive

On Linux, as I’m running good-old bash, it is as simple as running:

apt install zoxide fzf
echo 'eval "$(zoxide init bash)"' >> ~/.bashrc

For fzf, key bindings (Ctrl+T / Ctrl+R / Alt+C) and fuzzy auto-completion on Ubuntu are not enabled by default so you have to add in your ~/.bashrc:

echo '[ -f /usr/share/doc/fzf/examples/key-bindings.bash ] && source /usr/share/doc/fzf/examples/key-bindings.bash' >> ~/.bashrc
echo '[ -f /usr/share/bash-completion/completions/fzf ] && source /usr/share/bash-completion/completions/fzf' >> ~/.bashrc

ali čak ni to nije dovoljno jer ga možda nema: README.Debian says to source /usr/share/doc/fzf/examples/completion.bash, but file no longer exists · Issue #2790 · junegunn/fzf pa moram da ga download u svakom slučaju

if [[ ! -f /usr/share/doc/fzf/examples/completion.zsh ]]; then sudo curl -o /usr/share/doc/fzf/examples/completion.zsh sudo curl -o /usr/share/doc/fzf/examples/key-bindings.zsh fi

if [[ ! -f /usr/share/doc/fzf/examples/completion.bash ]]; then sudo curl -o /usr/share/doc/fzf/examples/completion.bash sudo curl -o /usr/share/doc/fzf/examples/key-bindings.bash fi

ali pošto prijavljuje grešku unknown option: --scheme=history, mora starija verzija (commit: 6dcf5c3):

curl -o /usr/share/doc/fzf/examples/key-bindings.bash

Napisao sam upustvo: Configuring Key Bindings and Fuzzy Auto-Completion in Ubuntu 22.04 · Issue #3395 · junegunn/fzf

The fzf and ubuntu docs don’t mention you have to.

Improve ls Command

Dok se exa ne pojavi na Windows, ovo mi je jedino rešenje:

Making functions permanent in Powershell

function ll { Get-ChildItem -Force @args }

Add to $profile.AllUsersAllHosts

CLI File Manager

  • mc aka Midnight Commander is the most famous one
  • lf is improved ranger, but multi-platform

The following ones are not available on Windows:

  • nnn won’t test it as even Ubunutu setup is not straightforward
  • xplr is very nice TUI file explorer
  • noice is small file browser
  • ranger console file manager with VI key bindings
  • clifm is terminal file manager, missing on Ubuntu
  • joshuto is ranger-like terminal file manager in Rust, not on Ubuntu
  • felix is TUI file manager with vim-like key mapping, not even on Ubuntu
  • chafa is amazing image viewer, but inside terminal. Yes, that’s possible - but almost.

TUI libraries

TUI stands for “Text-based User Interface” or “Terminal User Interface”.

Notes on Some Specific Tools

Midnight Commander

Midnight Commander installed using Scoop stores it’s key mappings in $env:userprofile\scoop\apps\mc\current\etc\mc.keymap

date 13. Feb 2023 | modified 29. Dec 2023
filename: Windows » CLI » Modern Linux Tools Alternatives