Man Pages Too Complex? Try tldr to Learn Linux Commands
Linux & macOS Terminal
Quick Links
-
What Is tldr and Why Is It Better Than man?
-
How to Install and Use tldr
-
The tldr Website Is Almost as Good
Key Takeaways
- tldr simplifies Linux command help with concise, accessible pages and key examples.
- Install tldr using npm or Homebrew, then use commands like “tldr grep” to quickly access command help.
- The tldr website offers the same detailed pages as the command line tool, with search autocomplete and GitHub links.
Man pages are the ultimate source of help on Linux commands, but they’re very dense and not at all beginner-friendly. Enter tldr, a command which makes it much easier to use the command line.
What Is tldr and Why Is It Better Than man?
Tldr works like man, the default way of getting help on Linux commands. Its name references the common internet initialism TL;DR, short for “Too Long; Didn’t Read.” Instead of man pages, the tldr command shows tldr pages which are much more accessible alternatives.
Each tldr page begins with the name of the command, a one-sentence description of what it does, and a URL for more detailed information, usually a version of the corresponding man page.
Following this is tldr’s most valuable feature: a list of examples. While the man pages contain examples, they’re usually right at the bottom, or in usage format which isn’t always easy to understand. Tldr elevates examples and includes just the right number: enough to cover the most important cases, but not so many as to be unwieldy.
Take cd, for example, a command you probably use more than almost any other. You might think you know all there is about this extremely simple tool, but tldr could help uncover some hidden uses:
The “user’s home directory” and “previously chosen” are really useful variations that you may not have known about.
How to Install and Use tldr
The tldr pages are written in Markdown and, as a side effect, there are many different client programs you can use to view them. A console client makes the most sense, since you’re probably already on the command line when you’re looking for help.
The original console client requires npm, the JavaScript Node Package Manager. If you have npm, you can use it to install tldr like this:
npm install -g tldr
The npm install is the recommended route. If you don’t have npm and want to install another way, you can use Homebrew (“brew install tldr”) or refer to the extensive list of clients on tldr’s GitHub page.
Once installed, use tldr and pass it the name of a command, just as you would with man, e.g.
tldr grep
You can search the tldr pages for any text that might occur in an example or the description of a command. Just use the “–search” option like this:
tldr --search "change permissions"
If you want to see just how many commands tldr covers for your platform, you can use the “–list” option. By default, this will show all commands on one huge comma-separated line. Add “-1” to view one per line.
tldr --list
You can even—perhaps unsurprisingly—use tldr for help about itself:
tldr tldr
You’ll see examples that cover all cases, including options for language-specific help and information for specific platforms.
With tldr installed, try adding “tldr –random” to your
.bashrc or equivalent
. The –random option shows info for a random command; there’s also “–random-example” to show just a single example of usage. Now, each time you open a new terminal it will introduce you to a new command.
The tldr Website Is Almost as Good
The command line tool provides tldr pages exactly where you want them: on the command line. But the official website provides its own interface with all the same details, formatted for your browser.
It may not always be as convenient as the command, but the website includes some nice touches.
- The search has full autocomplete and highlights where commands are Linux or Mac-specific.
- Each page links to its corresponding source on GitHub. If you ever feel like contributing to the project, this is a great place to start. You can even use GitHub’s built-in tools to submit your changes directly on the site, without having to learn anything about git.