Explainshell – A New Use for Man Pages
A More Modern Man Page

Photo by Brett Jordan on Unsplash
Explainshell aims to make documentation more accessible.
Man pages are the most common form of documentation for Linux. However, they first appeared in 1971, designed for a small audience of experts. As a result, while they generally provide an exhaustively thorough summary of their topics, from a modern perspective, they can have several limitations. Their thoroughness can be intimidating for new users, and some contain numerous options, many of which are obscure because they are not frequently combined. Nor do they always cover which multiple commands are combined through pipes or joined by regular expressions and notations unique to a particular programming language. Consequently, recent years have seen attempts to address these limitations. For instance, tldr provides quick references for the most common use cases of commands. More recently, explainshell has appeared, an online resource that parses commands like high school English classes parse sentences. By doing so, it provides a quick reference to complicated commands, as well as a useful learning tool. If you have ever wondered about the commands for installing software without a package system are about, explainshell can be especially useful. It can also be a handy way to check the validity of commands or Bash scripts.
Explainshell was written by Idan Kamara as part of an ongoing effort to make documentation more accessible. It is based on 29,761 man pages from Ubuntu. As the project's GitHub page explains, explainshell uses Python scripts to convert these pages to HTML, then classifies each paragraph as an option or not. Options are then extracted and stored, and matched to the relevant help text. When a query is made, it is parsed into an Abstract Syntax Tree (AST), and explainshell notes likely relevant commands or shell-related nodes such as pipes. The results are rendered using Flask, a lightweight web application for Python, that makes for quick results. Currently, there is no way to enter any additional man pages, although the GitHub page suggests that might be possible in the future, and it is an obvious way for a small project to grow. The GitHub page also includes instructions about how to install a local version of explainshell using Docker (Figure 1), as well as how to parse and save a gzipped man page in raw format (Figure 2).

[...]
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

News
-
System76 Releases COSMIC Alpha 7
With scores of bug fixes and a really cool workspaces feature, COSMIC is looking to soon migrate from alpha to beta.
-
OpenMandriva Lx 6.0 Available for Installation
The latest release of OpenMandriva has arrived with a new kernel, an updated Plasma desktop, and a server edition.
-
TrueNAS 25.04 Arrives with Thousands of Changes
One of the most popular Linux-based NAS solutions has rolled out the latest edition, based on Ubuntu 25.04.
-
Fedora 42 Available with Two New Spins
The latest release from the Fedora Project includes the usual updates, a new kernel, an official KDE Plasma spin, and a new System76 spin.
-
So Long, ArcoLinux
The ArcoLinux distribution is the latest Linux distribution to shut down.
-
What Open Source Pros Look for in a Job Role
Learn what professionals in technical and non-technical roles say is most important when seeking a new position.
-
Asahi Linux Runs into Issues with M4 Support
Due to Apple Silicon changes, the Asahi Linux project is at odds with adding support for the M4 chips.
-
Plasma 6.3.4 Now Available
Although not a major release, Plasma 6.3.4 does fix some bugs and offer a subtle change for the Plasma sidebar.
-
Linux Kernel 6.15 First Release Candidate Now Available
Linux Torvalds has announced that the release candidate for the final release of the Linux 6.15 series is now available.
-
Akamai Will Host kernel.org
The organization dedicated to cloud-based solutions has agreed to host kernel.org to deliver long-term stability for the development team.