DEV Community

Cover image for tldr: A Delightful Command Line Tool For Programmers In A Hurry
Erik Anderson
Erik Anderson

Posted on

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]

Top comments (3)

Collapse
 
klip_klop profile image
Kacey Gambill

Thanks for sharing about that tool! That was super fun to play with.

I can only hope that they eventually allow functionality like cht.sh allows! I use curl cht.sh/egrep as I learn most new commands!

Collapse
 
ekand profile image
Erik Anderson

You're welcome!

cht.sh sounds interesting. I'll take a look later today.

Collapse
 
dasheck0 profile image
Stefan Neidig

Looks cool