Unreadable Linux terminal? 5 modern substitutes (and alias) so as not to go crazy with the data

Published by TheJoe on

Estimated reading time: 5 minutes

Let's tell the truth: Native Linux commands are cornerstones of computing, but many of them were designed between the 70s and 90s, when the monitors barely showed 80 green text characters on black background.

Today, if you run a command to see the disk space on your OpenMediaVault NAS, you find yourself faced with misaligned tables. If you're trying to figure out which folder is filling up the server, a slew of flat text awaits you. And if you switch to Docker, basic commands such as docker ps, docker stats the docker images they suffer from the exact same problem: information overload. The tables are so wide that they wrap, destroying the layout and transforming the terminal into a hieroglyph.

Today we see how to resolve these deadlocks in which the modern terminal becomes unreadable, using next-generation utilities or intelligent aliases.


1. Monitor disk space: the df -h a duf

The standard situation

You want to know how much memory is left on your hard drives. Launch the classic df -h. The result? A gray table, where real physical disks are mixed with dozens of virtual partitions in the system (i vari loop of Docker or Snap packages), forcing you to scroll the screen to find what interests you.

The modern alternative: Scent

Scent (Disk Usage/Free) is a replacement written in Go. When you launch it, analyzes the disks and generates a very clean table, automatically splitting local devices, network ones and virtual ones. The most beautiful thing? Shows colored progress bars (Verde, Giallo, Rosso) to quickly understand which disk is at its limit.

How to activate it

Su Debian/Ubuntu and derivative, it simply installs with:

sudo apt install duf

To make it permanent, open yours ~/.bashrc (or the root file /root/.bashrc) and create an alias to replace the old command:

alias df='duf'

2. Find heavy files: the du -sh a ncdu

The standard situation

The disk is full at 99%. You need to figure out which folder is taking up all this space. The standard command is du -sh *. The terminal yes “freeze” for several minutes and then spits a messy textual list at you. If you want to investigate inside a subfolder, you have to launch a new command, wasting a lot of time.

The modern alternative: Ncdu

Ncdu (NCurses Disk Usage) transform this research into an interactive experience. It scans the disk once and shows you a screen where you can navigate between folders using the keyboard arrows. Files and folders are automatically sorted from heaviest to lightest, accompanied by a graphic bar. You can even delete a useless file instantly by pressing the button d.

How to activate it

sudo apt install ncdu

Just type ncdu to launch the analysis of the folder you are in.


3. Real-time hardware resources: the top a btop

The standard situation

The server is slowing down and you want to see what is consuming CPU and RAM. Launch top (or the most common htop). Although useful, they show text graphics a bit’ dry and require you to remember complex keyboard shortcuts to sort processes.

The modern alternative: Btop

Btop it is the king of system monitors. It has a stunning graphical interface right in the terminal: shows CPU trend graphs core by core, memory usage, disk read/write speed and network traffic peaks. It is fully customizable and even supports using the mouse via SSH to click and kill annoying processes.

Look here:  The Linux terminal doesn't have to be "bad"

How to activate it

sudo apt install btop

You can replace the old tracking by adding this alias into yours .bashrc:

alias top='btop'

4. Cleanup in Docker: list active containers with dps

The standard situation

When you launch the classic docker ps to see which containers are started, Docker tries to show you everything: ID, source image, boot command, creation date, state, doors and names. If you have more than two containers, the text breaks and wraps on three lines for each real line, making it impossible to immediately understand whether a service is active or off.

The solution: l’alias dps

We can leverage Docker's native formatting engine to cut through visual noise. We only keep the four vital pieces of information: the abbreviated ID, the name of the container, the current state and associated ports.

How to activate it

Paste this strategic alias into your file .bashrc:

alias dps='docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Status}}\t{{.Ports}}"'

Simply typing dps, you will get a narrow table, symmetrical and very clean that will never fall apart again.


5. Tame Docker images with dimages

The standard situation

Similar to what happens with containers, typing docker images to see the images saved on the server you are faced with infinite repository names and very long hashes that take up precious horizontal space on the monitor.

The solution

Let's clean up by telling Docker to print only the project name (Repository), the version (Tag) and the actual space it takes up on the disk (Size).

How to activate it

Open yours .bashrc and create this other shortcut:

alias dimages='docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}"'

6. Monitor container consumption: dstats

The standard situation

You want to know how much RAM and CPU your containers are consuming right now. The native command docker stats shows a slew of data that includes the ID of the expanded container, total network limits and disk I/O. Here too, the table regularly goes beyond the edges of the monitor.

The solution

We apply the same principle of selective reduction, isolating only the container name, the percentage of CPU, the RAM used and the network input/output.

How to activate it

Add the last space-saving alias to your configuration file:

alias dstats='docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}"'

Typing dstats you will have a streamlined control panel, updated in real time and perfect for placing alongside other windows on the desktop.


Conclusions

The Linux terminal doesn't have to be a punishing or difficult to crack environment. Replacing old commands with utilities written in modern languages (come Go o Rust) or by leveraging Docker's native formatting engines, we can transform hours of headaches into an immediate visual experience, tidy and relaxing.

Set up these aliases on your home PC or server and you will never go back!

Categories: General

TheJoe

I keep this blog as a hobby by 2009. I am passionate about graphic, technology, software Open Source. Among my articles will be easy to find music, and some personal thoughts, but I prefer the direct line of the blog mainly to technology. For more information contact me.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.