9 Modern Alternatives to Classic Linux Commands

0

There are a number of Terminal utilities that virtually any Linux machine includes in its default installation (and, in most cases, even in its minimal installation). They are essential for the operation of other tools and, in fact, accompany Linux from its very birth, since all of them were born years before for Unix or compatible systems (such as BSD).

But, over the years, there have been alternatives that improve and / or simplify your most veteran referents, and many of them have already earned a little hole in the hearts of Linux users. Let’s see some of the most outstanding:


LINUX and GNU: LINUX: WHAT IT IS and HOW IT WORKS

Cat vs. Bat

‘Cat’ (short for ‘concatenate’) is a command that allows us to create or merge files, or ‘print’ them to standard output (showing them in the terminal or redirecting them to another file).

For its part, ‘bat’ (defined as ‘cat with wings’) substitutes cat in all its functions, adding other useful ones such as automatic syntax highlighting for a wide number of programming and markup languages, integration with Git (highlighting the modifications), automatic paging or the option to display non-printable characters.

Cat

‘Bat’

Linux step by step: the five terminal commands that every Ubuntu user should know

Cd vs. Zoxide (Z)

Possibly the most used command when working with the terminal, ‘cd’ (acronym for “change directory”) does exactly that, allow us to change directory (folder) to run the relevant commands in each one.

But what if ‘cd’ performed keep track of the directories we use most frequently and resorted to a classification algorithm to navigate to the best match, avoiding having to write complex routes over and over again? Well then the program would be called Zoxide and would use ‘z’ as command.

Zoxide

Diff vs. Diff-so-fancy

‘Diff’ (short for “difference” in English) allows us to visualize the differences between two files or two directories. Obviously, it is one of the commands most used by developers, frequently in combination with Git, in order to know which lines of code have changed between two versions of the same program.

But nevertheless, a common criticism of ‘diff’ is that it seems more intended to be machine readable than human; therefore, in order to better recognize the changes at a glance, they have launched ‘diff-so-fancy’, which dispenses with the use of symbols such as ‘+’ and ‘-‘, and bet instead on improved text highlighting.

Diff

‘Diff’ vs. ‘Diff-so-fancy’

The 10 Most Dangerous Text Commands for Windows, Linux, and Mac

You vs. Ncdu

‘From’ (acronym for ‘disk usage’) is a command that allows showing how much directories and files occupy on the disk, allowing – according to the arguments that we are passing to the program – to know which ones are the most occupying. Thus, if we wanted to know the 5 heaviest directories and show them ordered on the screen with human-readable units (MB, GB, etc.) we should write something like the following:

du -hs * | sort -nr | head

However, ‘ncdu’ is an alternative that not only directly shows us the same information than the previous complex command, but it is accompanied by bar graphs … and allows us to navigate between directories to know, in turn, the ‘weight’ of each of the folders they contain. Or delete them:

Ncdu

‘Ncdu’

Find vs. Fd

‘Find’ literally means “to find” in English; and that’s exactly its mission, to search for files on the hard disk following the criteria that we provide (the name of the file or part of it, the name of the user, the size of the file, etc).

‘Fd’ does not include as many options and modifiers as ‘find’, but it does constitute a simpler alternative to it in most cases. Thus, for example, where to find any MP3 file in the current directory, before it was written

$ find . -iname “*.mp3”

… now it would be enough with a simple ‘fd .mp3’.

Fd

‘Fd’

Six useful Linux commands you probably didn't know about

Ls (y Tree) vs. Exa

‘Ls’ it is probably close to ‘cd’ in terms of frequency of use by Linux users. Its function is very simple: list the files and folders within a directory, the equivalent of open the same in file explorer. ‘Tree ‘would be the equivalent of the navigation panel of this one, showing all the subdirectories in tree format.

Well, ‘Exa’ offers the same functions as both, but making use of a colored output that allows you to differentiate between file folders at a glance, as well as identifying permissions and owner users, and shows extra information if we view Git repositories, in addition to handling dates in standard format (and not in the Anglo-Saxon).

Exa

Exa

For supply the functions of ‘tree’, just use

$ exa –tree

Man vs TLDR

Nowadays it is common to search Google for information on how to use any program with which we are not familiar, but at the time, in the early days of Unix, there was neither Google nor the Internet, so the documentation of each program was installed together with it and was (and is) searchable using the ‘man’ command (from ‘manual’).

The problem with ‘man’ is that the first-time user who uses it sees how he drops a huge paragraph with all the detailed options of the consulted program, and that is not always useful. In many cases, more than a manual we need a cheat sheet, and that is what ‘tldr’ offers us: summarized versions of the manuals for each command, focused on showing us practical and simple examples.

Tldr

This website offers a sample of the output that ‘tldr’ would provide in each consultation.

Four basic tools for filtering and processing text on command line: sed, grep, cat, and awk

Sed vs Sd

‘Sed’ is the abbreviation of ‘Stream Editor’, and it is a word processor in the most traditional sense of the term: the arguments that we pass to the command will allow us to transform the content of one or more text files, allowing us to – for example— cut text or replace it according to certain criteria.

‘Sd’ is capable of doing most of the things that ‘Sed’ does, but it makes them much easier. In part, thanks to the fact that the syntax for regular expressions that it uses is the same that we can find in JavaScript, much simpler than that of ‘sed’ and ‘awk’. So, for example, two commands like:

$ sed s/before/after/g

$ sed ‘:a;N;$!ba;s/n/,/g’

They become:

$ sd before after

$ sd: sd ‘ n’ ‘,’

Top vs. Htop

‘Top’ is a command that offers a set of statistics (updated every few seconds) about the use of our system: RAM and SWAP memory, CPU usage, and — above all — the most active processes when using them. reurusians. ‘Htop’ is very similar, only better: colored display, more readable ‘layout’ of the data, use of graphics, etc.

Htop

LEAVE A REPLY

Please enter your comment!
Please enter your name here