Skip to content

I Don’t Know Every Linux Command, I Cheat.sh

You can’t expect someone to remember every single Linux command. Every now and then you need to ask a friend, a co-worker or take the inevitable trip to Stackoverflow for answers. But if nobody is around and you are locked in a server room working on a headless server that doesn’t have a web browser, what do you do?

As the title says, cheat! Cheat.sh is an application that aims to be a unified access to every known and reputable cheat sheet repository in the internet. It’s goal is to meet 7 different criteria.

  • Concise : offer only what you need
  • Fast : work instantly
  • Comprehensive : provide answers for every question.
  • Universal : should run everywhere
  • Unobtrusive : shouldn’t distract you
  • Tutoring : help learn the subject
  • Inconspicuous : can use it without really noticing.

Cheat.sh has many features. It has a simple interface. It offers answers to 56 programming languages, several database management systems and over 1000 Linux commands. Cheat.sh curates the best cheat sheets on the internet. It doesn’t require an installation but does offer a client as well. The application is also very fast as it has a rule to return answers within 100 ms. You can use it within code editors and the terminal without the need for a browser.

How to use

If you do not want to install the cht.sh client, all you need is the curl command which is usually available in most Linux distributions by default. To get an answer you can use any of the following commands, including options to encrypt your query with HTTPS.

curl cheat.sh/<query>
curl cht.sh/<query>
curl https://cheat.sh/<query>
curl https://cht.sh/<query>

Let’s give it a try for the tar command. A program that is usually used for making backups on Linux.

Cheat.sh fetches and displays all the most useful variations for the tar command. This is great if you forget a specific settings flag for creating an archive for your files. Note that this is so much faster than opening up a browser, querying Google and then sifting through the results.

Have a programming question? No problem!

As stated before, Cheat.sh isn’t only for Linux commands. It provides an interface for querying programming issues as well.

curl cht.sh/<programming-language>/<query>

If you want to know how to open up a file in the Python programming language, you can use the following query command.

curl cht.sh/python/read+file

Using the cht.sh client

If you want to shorten your Cheat.sh query commands and have access to more features, you can download and install the client.

curl https://cht.sh/:cht.sh | sudo tee/usr/local/bin/cht.sh
chmod +x /usr/local/bin/cht.sh

When you install the client you can stop using curl and use the cht.sh command.
Note that you can now omit the + in your queries with spaces.

cht.sh python read file 

You can even drop in to a shell mode. If your queries are specific to a certain programming language, you can specify the language for numerous easy queries.

cht.sh --shell
cht.sh> cd python
cht.sh/python> open a file

Wrap up

Cheat.sh is an indispensable tool to streamline your Linux and other programming language questions. It will save you time from searching in a browser and gives you quick access to accurate information. Take some time to use the application and you will see it saves a lot of time. Try it today and you might be surprise how much less time you spend on Stackoverflow, ServerFault, and SuperUser.

Michael has been a professional in the information technology field for over 10 years, specializing in software engineering and systems administration. He studied network security and holds a software engineering degree from Milwaukee Area Technical College with thousands of hours of self taught learning as well. He mainly writes about technology, current events, and coding. Michael also is the founder of Sof Digital, an U.S. based software development Firm. His hobbies are archery, turntablism, disc golf and rally racing.

Comments are closed, but trackbacks and pingbacks are open.