tldr: A Delightful Command Line Tool For Programmers In A Hurry

datadeverik

Erik Anderson

Posted on August 22, 2023

tldr: A Delightful Command Line Tool For Programmers In A Hurry

Quick! You need to get a shell command to do what it's supposed to do for you and you don't have time to read a think man page or scour the internet for tutorials.

What can you do?

Well, have I got the tool for you:

It's called tldr.

That stands for "Too Long, Didn't Read", and it's a command line tool that gives you short, thoughtful summaries of command line tool documentation with instructive examples.

As an introduction, consider pwd:

āžœ  ~ tldr pwd

  pwd

  Print name of current/working directory.
  More information: https://www.gnu.org/software/coreutils/pwd.

  - Print the current directory:
    pwd

  - Print the current directory, and resolve all symlinks (i.e. show the "physical" path):
    pwd -P


āžœ  ~
Enter fullscreen mode Exit fullscreen mode

Isn't that neat? And I honestly didn't know that part about the "physical" path.

Let's say you need to work with Docker, but you don't know where to start. tldr to the rescue!

āžœ  ~ tldr docker

  docker

  Manage Docker containers and images.
  Some subcommands such as docker run have their own usage documentation.
  More information: https://docs.docker.com/engine/reference/commandline/cli/.

  - List all docker containers (running and stopped):
    docker ps --all

  - Start a container from an image, with a custom name:
    docker run --name container_name image

  - Start or stop an existing container:
    docker start|stop container_name

Enter fullscreen mode Exit fullscreen mode

Note: in the spirit of "too long, didn't read", I only shared the first half of the output for this example. But even just those three command examples give you a pretty good starting point with the docker command, and with Docker as a whole, for that matter.

How can you get tldr in your terminal, in case you want to read the full entry for docker, or have it available for all your command line reference needs?

You can find all you need to get started at the appropriately short web address: tldr.sh. There you can try an in-browser version or see instructions to install the tool on your machine.

Happy coding, and I hope you find this delightful little tool helpful!

[Edit: you can also see my video about this on YouTube]

šŸ’– šŸ’Ŗ šŸ™… šŸš©
datadeverik
Erik Anderson

Posted on August 22, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related