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.
If you want to know how to open up a file in the Python programming language, you can use the following query command.
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
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.