Show Menu
Cheatography

Unified Cheat Sheet (DRAFT) by

Common usage cheat sheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

tmux

Ctrl+z c
Create new window
Ctrl+z  ,
Rename window
Ctrl+z [0-9]
Switch to window
Ctrl+z |
"
Split horizontal
Ctrl+z -
%
Split vertical
Ctrl+z [arrow]
or
Alt + [arrow]
Move between panes
Ctrl+z z
(Un)Zoom pane
Ctrl+z  $
Rename session
Ctrl+z  s
Change session
tmux new [-s NAME]
Create new session
tmux ls
List sessions
tmux [a|attach] [-t NAME]
Attach to session
A session holds at least one window that holds at least one pane.

vim

:noh
disable highlight
\c
Case insens­itive
:2,4co10
Copy lines 2 to 4 in line 10
:2co.
Copy line 2 under current line
]s
Spell check: next mispelled word
[s
Spell check: previous misspelled word
z=
Spell check: spelling suggestion
:[RANG­E]s­/{p­att­ern­}/{­str­ing­}/[­flags]
Replac­e(s­ubs­titute)
gcc
comment line
gc
(In visual) comment lines
Replace:
{pattern}
: Literal or regular expres­sion.
\c
at end to case insens­itive
[flags]
:
g
all occurences
i
for insens­itive search

vim ranges

99
line 99
.
current line(d­efault range)
%
all lines(same as 1,$)
1,99
Lines 1 to 99 both included

sed

`sed 's/FOO­/BAR/g' file
Replace any FOO occurrence with BAR in file
-i
Persist changes in file

awk

awk '{ print $1, $3 }' file
Print first and third column in file
-F ','
Use comma as a field separa­tor­(de­fault: space)
 

find

-type [f|d|l|s]
restrict to files(f), direct­ori­es(d), links(­l)...
-name <TE­XT>
name to find. Allow blob
-o
OR

grep

-r
recursive
-i
ignore case
-v
invert match
-n
show line number
-e
pattern to search
--incl­ude­=GLOB | --excl­ude­=GLOB
search­/ex­clude files whose name match GLOB. Use
{,}
for more than one value
--exlu­de-­dir­=GLOB
Same usage as
--include
-I
Ignore binary files

screen

screen -x
Attach
Prefix
Ctrl+a
Prefix­(Cu­stom)
Ctrl+z
<pr­efi­x> d
Detach
<pr­efi­x> A
Rename current window
<pr­efi­x>:­ses­sio­nname foo
Rename session
<pr­efi­x> c
Create new window
scren -S <na­me>
Create new session named <na­me>

emacs

ctrl-x ctrl-c
Exit

system shortcuts

Area screenshot
Shift + print
Area screenshot to clipboard
Shift + Ctrl + print
Window screenshot
Alt + print
Window screenshot to clipboard
Ctrl + Alt + print