www-gem words

Alternatives to default commands

Published on

cli If you’re using the command line on a daily basis, you already know the power of the commands. The classic commands are great but like everything they can benefit from some modernization that offer additional benefits which improve usability for modern systems. Here is a list of the ones I use for years now but there are more options available:

╭── Used to sudo, try doas

doas is acting the same way sudo is by allowing users to perform tasks as root. It is a portable version of OpenBSD’s doas command. Its advantage is to be a minimalistic alternative to sudo and so a much smaller tool. On the other hand, sudo offers more fine-grained control.

The main advantage of doas is also its drawback: a simpler configuration file. Configuring sudo is done through the /etc/sudoers file which is so complex for the average user that you have to use visudo to to not create an improper config file and lock yourself out of your system.

Hence sudo is really needed for people who need its advanced configuration and granularity. To make it simple, if you are a single-user or running a multi-user personal machine, then doas is sufficient. doas may be limited for enterprise sysadmin who have to accommodate granular settings for a huge number of users.

If you’re ready to give doas a try then I’d recommend following the very well written Archwiki .

╭── You like your cat? Have you ever meet a bat?

As other tools in this list, bat completes the same tasks as the historical tool but with some nice additional features to make it easier to visualize your text:

╭── You can grep. Even better you can ripgrep. But then you ripgrep-all.

ripgrepall is ripgrep with the ability to search in pdfs, e-books, office documents, archives, database, images (with OCR), videos’ subtitles…

With this list you can imagine the power of such tool and the list of options and adapters on the github page will help you getting the best out of ripgrepall. In terms of configuration, I personally love the integration with fzf and being able to define the color of matching terms and how many lines to show before and after each match. You could for example run a search through an entire directory and show the results in fzf with a nice preview in context for each file. Maybe more on that in a future post ;)

╭── 50% shorter than find: fd

This title is actually the last “advantage” listed on the fd github page .

fd comes with:

fd is simpler, faster, and more user-friendly than find but is not meant to completely replace it (even though I’m personally using fd only for years now).

╭── Advanced copy and move

advcpmv is not a rewrite of a tool but a mod of the GNU cp and mv tools. While the default commands let you in the dark when copying/moving huge files/directories, advcpmv shows you:

advcpmv is to me what the default commands should have always been and as a consequence it replaces them on my system. You can easily do the switch by following the instructions on the project’s github page.

╭── exa: ls under steroids

exa is not only bringing colors to ls, there is the --color=auto ls option for that. exa comes with these features:

As the other tools in this list, this is just a brief summary to a powerful tool with more options to discover on the project’s github page and official website .

╭── htop has reached its zenith

zenith is mostly a graphical improvement of htop. It adds zoomable chart views (with support to scroll back in time) for CPU, memory, network, and disk usage. Other features include:

╭── You’ve improved your home trash system, do the same to your computer

trash-cli is a CLI to FreeDesktop.org Trash and offers 5 commands:

The main advantage over rm is to be able to store your trash and decide when you really want them to go away. This may save you from deleting a file/directory by mistake or help you recovering a file/directory because you eventually changed your mind.

If you are thinking about aliasing rm to trash-put, the project’s github page tells you that you shouldn’t because trash-cli has different semantics which will cause you problems. For example, while rm requires -R for deleting directories trash-put does not. I personally like not having to use the -R flag and I didn’t notice other “issues” so I went into rebellion and aliased rm to trash-put.

Thanks for your read. Hope it's been useful to you.

Interact with this post using Mastodon or

Comment on wwwgem's post

Copy and paste this URL into the search field of your favourite Fediverse app or the web interface of your Mastodon server.

✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈

More food for thoughts? Check other posts about: #Cli