Cheat Sheet

Some of the commands below are from my personal config files or package builds. See Setup for details.

terminal

CTRL+TFuzzy search for files
CTRL+ZStop foreground program
fgRestore stopped program to foreground
bg job_idResume stopped program in background
jobsShow running and stopped programs

tmux

SHIFT+LEFT MOUSE BUTTONCopy to primary clipboard
CTRL+B, \Split window with new pane in current path on right
CTRL+B, -Split window with new pane in current path at bottom
CTRL+B, /New window in current path

dwm

SUPER+SHIFT+ENTEROpen terminal window
SUPER+SHIFT+CClose window
SUPER+PLaunch dmenu
SUPER+SHIFT+QQuit DWM
SUPER+LLock screen

vim

:set listShow whitespace
:syntax sync fromstartFix syntax highlighting
g-Go to older text state
g+Go to newer text state
CTRL+R, 0Put last yanked string into command line
:g!/pattern/dDelete lines not matching pattern
:%!jq .Prettify JSON

cmus

yAdd to playlist
EAdd to play queue
xPlay
cPause

files

Extract gzipped tarball

tar xzvf target.tar.gz

Extract bzipped tarball

tar xjvf target.tar.bz2

http

Fetch JSON and pretty print

curl URL -s | json_reformat

audio

Start JACK

jack_control start

Stop JACK

jack_control stop

systemd

Boot into text mode

systemctl enable multi-user.target
sudo systemctl set-default multi-user.target

git

List branches ordered by last change

git branch --sort=-committerdate

Log summary

git log --pretty=oneline --abbrev-commit

mysql

Dump structure

mysqldump  --no-data -u user -p database >database-schema.sql

docker

Run MySQL container

docker run -p 8033:3306 --name mysql-5-6 -e MYSQL_ROOT_PASSWORD=password -d mysql:5.6.44

timedatectl

timedatectl set-ntp no timedatectl set-time 2021-01-01 timedatectl set-time 09:00:00