Quick Links

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.

Example output from tldr showing help for the mkdir command.
Remove Ads

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:

Example output from tldr showing six different examples of how to use the cd command.
Remove Ads

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
A tldr page showing information about the grep command.
Remove Ads

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"
Search results from the tldr page showing commands relevant to the phrase "change permissions," including umask and chmod.

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
Output from the tldr --list option shows a long list of supported commands separated by commas.

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.

Remove Ads
The tldr command showing help on itself.

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.

The Linux tldr web interface showing formatted help for the mkdir command.

It may not always be as convenient as the command, but the website includes some nice touches.

Remove Ads
  • 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.