Introduction
When you start learning Linux, you begin with a standard set of Linux commands that have been in existence since the UNIX days. As you grow old as a Linux user, you keep on mastering the same set of standard commands. But these standard, legacy commands were created several decades ago and while they do their intended jobs, their functionalities could be improved and the structure could be simplified.
Please note that you should not rely too much on these alternatives, specially if you manage (or plan to manage) numerous Linux servers. The legacy Linux commands are found on all Linux distributions, all Linux servers. These modern replacements are more likely to be not available on remote servers.
1. HTTPie: Alternative to wget and curl
When it comes to downloading files in terminal, wget and curl are the two of the most common tools. Interestingly, not all distributions have curl, wget installed by default.
HTTPie does the same job but in a more human-friendly way. You have colorized, formatted output which makes it easier to understand and debug.
Command to install:
sudo apt install httpie
2. Bat: Alternative to cat
The cat command is perhaps one of the first command you learn. It does the job for viewing the contents of small text files.
But bat command takes it to the next level by adding features like syntax highlighting and Git integration. Pagination option is also available.
Command to install:
sudo apt install bat
Command to use:
batcat "filename"
3. ncdu: Alternative to du command
The du command in Linux is used for checking the size of a directory. It’s not very straightforward command and it certainly doesn’t give a very good default output.
Compared to that, ncdu is a lot better than providing the relevant information at the first glance.
Command to install:
sudo apt install ncdu
Command to use:
ncdu "directory name"
4. Htop: Alternative to top command
The top command in works as the task manager in Linux terminal. It is a good tool for looking at running processes and resource consumption but understanding and using the top command could be complicated. It is also built into the Ubuntu system so no installation is needed.
Htop on the other hand has a pretty, colorful output and a more intuitive interface than the top command. You can scroll vertically and horizontally, configure the displayed information graphically etc. You can kill processes interactively right from the output screen of htop.
Command to use:
htop
5. Neovim: Alternative to Vim
I hope I am not committing a blasphemy here but a better Vim is not Emacs, it’s Neovim.
Years ago, Vim came up as an improvement to the legacy Vi editor. A few years back, Neovim came up with the idea to extend Vim as an IDE.
It adds modern terminal features such as cursor styling, focus events, bracketed paste etc. with a built-in terminal emulator. The best thing is that you don’t need to unlearn Vim to start using Neovim.
Conclusion
You have just learned some useful alternatives to some common Linux commands!
If you found this useful then please share this and follow me!