Learn How To Install The Command Line Cheat Sheet On Linux

April 13, 2019

Table of Contents

Introduction

Cheat is a python-based command reminder tool. Compared to lengthy and vague man and info pages, cheat provides distinct instructions to the options, arguments, or common uses of common commands. With cheat, system administrators can also edit existing cheat sheets or create custom cheat sheets for any subjects.

Cheat can be installed on all kinds of Unix-like systems. In this article, I will only demonstrate the steps on a CentOS server instance.

Prerequisites

Before moving on, you need to:

  • Deploy a CentOS server instance with the IT Web Services LEMP application.
  • https://www.itweb.services/tutorials/linux-guides/hot-backups-with-percona-xtrabackup-on-the-one-click-wordpress-app”>this tutorial.

Step one – Install pip and cheat

The easiest way to install cheat is with pip:

sudo yum update
sudo yum install -y python-devel python-setuptools python-pip
sudo pip install --upgrade pip
sudo pip install cheat

Step two – Configure cheat

Edit the current user’s .bashrc file to specify the default editor for editing cheat sheets, and to enable syntax highlighting:

vi ~/.bashrc

Add the following two lines beneath the line “fi”:

export EDITOR=/usr/bin/vim
export CHEATCOLORS=true

Save and quit:

:wq

Put the changes into effect:

source ~/.bashrc

Step three – Use cheat

To view a cheat sheet:

cheat [xyz]

[xyz] is the name of the command that you want to query.

To search a cheat sheet including your input [xyz]:

cheat -s [xyz]

All of the related contents in cheat sheets that include the phrase [xyz] will be displayed on the screen.

To list all of the available cheat sheets:

cheat -l

To edit an existing cheat sheet or to create a custom cheat sheet:

cheat -e [xyz]

To see the version of cheat program:

cheat -v

To see the store locations of cheat sheets:

cheat -d

Need help?

Do you need help setting up this on your own service?
Please contact us and we’ll provide you the best possible quote!