Access Linux command cheat sheet from command line

mary-kay-cheating-257x300Yes, Man pages are the best source for reference but quick short reference is always efficient then going through multiple pages.

Cheat is a command line tool by Chris Allen Lane  allowing you to access, create or update cheat sheets from the command line.

Installing Cheat

# yum install python-pip

# pip install docopt pygments

# git clone https://github.com/chrisallenlane/cheat.git
# cd cheat
# sudo python setup.py install

Example

# cheat mount
 To mount / partition as read-write in repair mode:
 mount -o remount,rw /

 Bind mount path to a second location
 mount --bind /origin/path /destination/path

 To mount Usb disk as user writable:
 mount -o uid=username,gid=usergroup /dev/sdx /mnt/xxx

 To mount a remote NFS directory
 mount -t nfs example.com:/remote/example/dir /local/example/dir

 To mount an ISO
 mount -o loop disk1.iso /mnt/disk

Auto Completion

Let’s make it more useful  by enabling command-line auto completion

# wget https://github.com/chrisallenlane/cheat/raw/master/cheat/autocompletion/cheat.bash
# sudo cp cheat.bash /etc/bash_completion.d/