Tugdual Gaillard

Notes / Blog

Cheat-Sheet and fuzzy-finder

Regular/permanent users of the command line know how frequently the limits of human memory can be reached. Here is a simple way to find a command quickly:

First, install the fuzzy finder fzf (you should install it anyway).
Then you just have to organize a text document where you classify and explain each command and write a bunch of keywords to make them easy to find. For example :

#+title: Cheatsheet

* Hardware, disk, usb

persistent disk hard drive parameters after suspend,sleep,resume create executable running hdparm command in: /usr/lib/systemd/system-sleep/hdparm

list devices (usb...) lsblk ou fdisk -l pour details

rename usb;rename usb with sudo mlabel -i /dev/sdd1 -s ::"usb_0"

configure auto mount point/directory for disk and usb device in /etc/fstab

Set disk drive sleep/suspend after idle time in /etc/udev/rules.d/

Get temperature of CPU cores : sensors

Get used and free space on USB flash drive, disk, or any storage media: df -h /dev/sdc1
.
.
.

Then you should add an alias to your .bashrc to search the document with fzf. I use sed to filter the document to supress the category titles.

alias cheat='sed -e '\''/^$\|^#\|^* /d'\'' <~/.config/cheatsheet/cheatsheet.org |\ fzf --preview-window=down:wrap --preview='\''echo {}'\'' '