Recall How to Use UNIX/Linux Terminal Tools Using cheat.sh and tldr

Hesam Gholami
3 min readApr 27, 2021

It may be happened for you when you want to use a terminal command but you don’t remember how to use it.

Reading Man Pages

You can read the man pages for any command or just use the internal — -help option of any command. But, it’ll be very useful if we could open up a cheatsheet quickly and see how to use that command.

Using Cheatsheets

There are tons of cheatsheets available for many tools and commands. For example if you want to see a quick cheatsheet of the scp command, you can search and probably find something like this.

These cheatsheets are very good and useful but it’s some kind of pain to search for a cheatsheet for every single command, because there are many more commands like ssh, cp, cat, rm, etc.

Keep Them All!

So it would be great if we could have them in one central place. Good news is that there are projects that done this before! So we can have a place for all cheatsheets of terminal tools and even some programming languages like Python!

One of these great cheatsheets are cheat.sh or cht.sh. We can append the command that we want, to the URL of this website and it’ll show us a handy cheatsheet. For example if we want to see a quick cheatsheet of scp, we can navigate to cheat.sh/scp and see one. This is amazing! But it’s not the whole story. We can also use this website in a simple terminal app. Let’s say we want to see cheatsheet of scp in our terminal. So we can use a tool like curl to fetch data from cheat.sh and it’ll show a terminal-friendly output for us:

A Linux terminal page fetching data from cheat.sh using curl
Retrieving data from cheat.sh in terminal results in a terminal-friendly output

That’s fascinating! we can replace scp with any command and see cheatsheet of that command!

It’ll even support some parameters. For example if we want to see a quick intro to Python, we can use: cheat.sh/python/:intro

A terminal window fetching data from cheat.sh
Retrieve an intro of Python using cheat.sh

Using Offline Tools

As you may be noticed, chea.sh is a website, but there are also tools that can be used offline. One of these tools is tldr.

Basically tldr is same as cheat.sh but it’ll be installed as a package on your OS and you can keep using it whenever you are offline. (But you should retrieve data when you are online)

You can use tldr for the scp command like this:tldr scp

That’s simple!

tldr or cheat.sh?

You maybe ask this question. The answer is: It depends on you. You can choose which one you prefer. Personally I prefer cheat.sh because it’s simple and has zero dependencies and it is available everywhere. But there isn’t really so much difference between these tools.

I hope you enjoy these tools and use them to make yourself more productive. Thanks for reading!

--

--

Hesam Gholami

Rustacean 🦀, C++ and Scala ninja by day and JS/TS guru by night, developer since 2011, FOSS lover, creator of puresoftware.org