Cheat.sh: list of bash terminal commands, codes and examples, a man on steroids

cheat.sh is a quick reference tool for programmers, sysadmins and/or DevOps/SRE’s, offering examples of Linux commands (bash terminal commands), codes from various programming languages and explanations of exactly what each one does.

Basic use

It can be used in this way, following this syntax:

curl cheat.sh/command

Example:

curl cheat.sh/curl

Expected result:

bash terminal commands
bash terminal commands

Various commands can be checked, such as tar, curl, rsync, tr, among other UNIX/Linux commands for which you want to get tips.

For hints for a UNIX/Linux command via the command line, query the service using curl or any other HTTP/HTTPS client by specifying the command name in the query:

# online linux terminal for practice / bash terminal commands
curl cheat.sh/tar
curl cht.sh/curl
curl https://cheat.sh/rsync
curl https://cht.sh/tr

Programming languages

You can also use cheat.sh to help with programming languages.

For programmers, cheat.sh offers a wide range of code examples from Java and other programming languages. You can quickly find the correct syntax or a usage example that solves your current problem. This saves time and increases efficiency in software development.

Programming language hints are located in special namespaces dedicated to them:

curl cht.sh/go/Pointers
curl cht.sh/scala/Functions
curl cht.sh/python/lambda
programming language examples

To get a list of available programming language hints, use the special query :list:

    curl cht.sh/go/:list

Almost all programming languages have a special page called :learn that describes the basics of the language (which is a direct mapping from the “Learn X in Y” project). It can be a good starting point if you’ve just started learning a programming language.

Learning Java – Java code examples

If you’re working with Java, cheat.sh also offers support:

# java programming language examples
curl cheat.sh/java/hello_world
curl cheat.sh/java/sort
curl cheat.sh/java/file_io
java programming language sample code
java programming language sample code

An example where cheat.sh provides the fundamentals and essential examples of the Java language:

# java programming language sample code
curl cht.sh/java/:learn
java programming language examples
java programming language examples

If there is no hint page for a programming language query (and this is almost always the case), it will be generated instantly, based on the hints and answers available on StackOverflow. Of course, there’s no guarantee that the returned cheat sheet will be a 100% success, but it’s almost always exactly what you’re looking for.

Try out these (and your own) questions to get an idea of what the answers are like:

    curl cht.sh/go/reverse+a+list
    curl cht.sh/python/random+list+elements
    curl cht.sh/js/parse+json
    curl cht.sh/lua/merge+tables
    curl cht.sh/clojure/variadic+function

Languages

cheat.sh langs

Stealth Mode

Being completely unnoticed is one of the most important properties of any glue.

Cheat.sh can also be used completely unnoticed. The cheat.sh client, cht.sh, has a extraordinary mode, called stealth mode.

Using this, you don’t even have to touch the keyboard to open a paste.

In this mode, as soon as you select some text with the mouse (and thus add it to the X Window System’s selection buffer or clipboard), it is used as a query string for cheat.sh, and the corresponding paste is automatically displayed.

Let’s imagine you’re having an online interview, where your interviewer asks you some questions using a shared document (let’s say Google Docs) and you have to write your coding answers there (it’s also possible that you type the questions yourself, just to show the interviewer that you’ve listened properly).

When using the stealth mode of cht.sh, the only thing you need to do to see a paste for some question is to select the question using the mouse. If you don’t want any text in the answers and all you need is code, use the Q option when starting stealth mode:

online linux terminal for practice

Integration with other tools

Use with text editors

You can be coordinated cheat.sh with content editors such as Vim, Emacs and Visual Studio Code. This allows you to access sample commands and code directly from your development environment, increasing your productivity even more.

Tools for Sysadmins and DevOps/SREs

For sysadmins and DevOps/SREs, cheat.sh can be integrated with automation tools and custom scripts. This makes querying commands (linux terminal command list) and code examples even faster and more efficient, making it a great tool for devops.

Author of the project

Project page:

cheat.sh

Project repository

More details can be found in the project repository:

https://github.com/chubin/cheat.sh

Final considerations

cheat.sh is an indispensable tool for programmers, sysadmins and SREs. It offers a quick and efficient way to consult Linux command examples, code and detailed explanations. By incorporating cheat.sh into your workflow, you can significantly increase your productivity and efficiency.

Try cheat.sh today and see how it can transform the way you work with Linux commands and code examples. For more content like this, keep following our blog and explore other productivity tools for programmers and DevOps/SRE.

Want to learn more?

Don’t forget to subscribe to our newsletter to receive the latest news and tips on DevOps/SRE directly in your e-mail:

Receive news by email

* campo obrigatório

Also, please read our other posts about Linux, to learn much more about this vital OS in our field and continue improving your DevOps skills.


Compartilhe / Share
Fernando Müller Junior
Fernando Müller Junior

I am Fernando Müller, a Tech Lead SRE with 16 years of experience in IT, I currently work at Appmax, a fintech located in Brazil. Passionate about working with Cloud Native architectures and applications, Open Source tools and everything that exists in the SRE world, always looking to develop and learn constantly (Lifelong learning), working on innovative projects!

Articles: 39

Receba as notícias por email / Receive news by email

Insira seu endereço de e-mail abaixo e assine nossa newsletter / Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *