Quick Links
Summary
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 likeman, the default way of getting helpon Linux commands. Its name referencesthe 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, orin usage formatwhich 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 arewritten in Markdownand, 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 may use it to install tldr like this:
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 ontldr’s GitHubpage.
Once installed, use tldr and pass it the name of a command, just as you would with man, e.g.
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:
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.
You can even—perhaps unsurprisingly—use tldr for help about itself:
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. Butthe official websiteprovides 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.