Magic Linux Commands

Magic Linux Commands

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

In my past 25 years, I have learned so many things about Linux, and yet I am still learning and discovering fabulous new material about the Linux Shell and their commands. In DevOps or Pair Programming sessions, my co-workers sometimes find it astonishing, what kind of commands I am writing. It looks like magic to some or like a hack to others.

For instance, take this command:

find . -type l -name test -exec file {} \; | awk '/broken symbolic link to/ { print }'

Above command searches for all broken symbolic links with name test and prints out the text with the file name.

If you do not know every detail and option of the respective commands, you end up calling the man page and check everything in it. This man inspection is very time consuming and may be error-prone.

Usually, I don’t like to explain basics to my co-workers, but I understand that each developer has a different background and affinity. I came across a beautiful gem, that does explain magic Linux commands elegantly. The website explainshell.com is a tool capable of parsing man pages, extracting options and explain a given command-line by matching each argument to the relevant help text in the man page.

explainshell find

For each option, the man page part appears, and you can easily match the information.

explainshell option

Your commands lose some myth and magic, but sometimes I need it myself to understand or check commands from my co-workers. Overall explainshell.com is a convenient method to look up a Linux command. The only drawback is: you have to leave your beloved terminal. 😂

Explainshell is an OpenSource project that holds a lot of potentials. It isn’t complete with all man pages. If you find the spare time during the holidays, why not contribute and make something beautiful more awesome.

Please remember the terms for blog comments.