TLDR Book
TLDR Book
TLDR Book
The Book
tldr-pages.github.io
Contents
1 COMMON 16
7z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7za . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7zr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
adb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
ag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
ansible-playbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
ansible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
apg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
apm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
apropos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
ar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
aria2c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
arp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
assimp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
atom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
autojump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
autossh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
avrdude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
aws s3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
axel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
base32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
base64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
basename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
bash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
bashmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
bc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
bedtools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
bg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
blender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2
bmaptool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
bower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
c99 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
cabal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
cal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
calibre-server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
calibredb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
cargo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
cat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
chgrp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
chmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
chown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
chsh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
cksum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
clang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
cloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
cmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
comm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
conda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
consul-kv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
consul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
convmv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
cordova . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
cowsay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
cp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
cpio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
cppcheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
crontab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
csvclean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
csvcut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
csvformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
csvgrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
csvlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
csvpy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
csvsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
csvstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
curl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
cut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
deluser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
df . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3
dhcpwn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
diff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
dig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
dirs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
dokku . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
drush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
ebook-convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
ed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
electrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
enca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
env . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
espeak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
exiftool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
fdupes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
ffmpeg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
fg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
fold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
fortune . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
fsck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
fswatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
fswebcam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
ftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
fuck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
fzf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
gcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
gem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
ghc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
gifsicle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
git add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
git bisect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
git blame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
git branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
git checkout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
git cherry-pick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
git clone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
git commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
git config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4
git diff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
git fetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
git-imerge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
git init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
git log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
git merge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
git mv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
git pull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
git push . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
git rebase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
git remote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
git reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
git rm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
git stash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
git status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
git submodule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
git svn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
git tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
git worktree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
git . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
gitsome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
glances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
gource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
gpg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
gradle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
grep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
gulp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
gunzip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
gzip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
handbrakecli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
haxelib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
heroku . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
hn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
htpasswd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
http . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
hub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
iconv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
ifconfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5
in2csv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
inkscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
ionice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
ioping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
ipcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
jar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
javac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
jhat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
jmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
jq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
jstack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
julia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
last . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
latexmk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
less . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
ln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
logstash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
lp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
lpstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
ls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
lsof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
lwp-request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
mailx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
make . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
man . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
mdp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
meshlabserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
meteor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
mitmdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
mitmproxy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
mkfifo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
mmv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
mocha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
mongo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
mongodump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
mongorestore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
montage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
more . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6
mount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
mp4box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
mpc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
msmtp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
mtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
mv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
mysql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
mysqldump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
nano . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
nc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
nginx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
ngrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
nice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
nix-env . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
nmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
nohup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
npm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
nslookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
nvm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
odps auth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
odps func . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
odps inst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
odps resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
odps table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
odps tunnel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
odps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
openssl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
optipng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
pandoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
parallel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
pass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
passwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
patch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
pdflatex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
pdftk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
pg_dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
pg_restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
pgrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
php . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
phpize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
phpunit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
7
pigz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
ping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
pip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
pkill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
pngcrush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
printf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
psql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
pushd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
pv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
pwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
pyenv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
qemu-img . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
qemu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
quota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
readlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
redis-cli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
redshift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
rename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
renice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
rev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
ripgrep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
rm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
rsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
rtv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
rustc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
sails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
salt-key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
salt-key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
salt-run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
salt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
samtools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
sass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
scp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
scrapy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
screenfetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
sed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
8
sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
seq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
sftp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
sh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
shopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
shred . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
skicka . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
sl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
slackcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
socat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
sox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
srm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
ssh-copy-id . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
ssh-keygen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
ssh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
sshfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
st-flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
st-info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
st-util . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
su . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
subliminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
supervisorctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
supervisord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
svn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
tabula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
tac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
tail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
tar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
tcpdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
tee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
tesseract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
tldr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
tldrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
tmux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
9
touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
tput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
tr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
traceroute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
transcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
tty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
ufraw-batch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
umount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
unar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
uniq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
unrar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
unzip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
uptime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
vagrant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
vim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
vimtutor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
virtualenv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
visudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
vue-cli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
w3m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
wc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
webpack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
wget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
which . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
while . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
who . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
whoami . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
x_x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
xargs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
xcv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
xz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
yarn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
yes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
youtube-dl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
zbarimg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
zcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
zdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
zfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
zip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
zless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
zpool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
10
zsh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
2 LINUX 194
adduser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
apt-cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
apt-get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
apt-key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
apt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
aptitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
archey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
at . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
beep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
brew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
bzip2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
chattr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
chroot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
cmus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
compose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
cryptsetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
dd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
dnf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
dpkg-query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
dpkg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
du . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
edquota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
emerge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
equery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
expand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
expr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
fc-list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
fc-match . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
fc-pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
figlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
findmnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
firewall-cmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
fuser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
getent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
groupadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
groupdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
groupmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11
head . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
hostname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
htop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
hwclock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
ifdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
ifup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
iostat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
ip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
iptables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
journalctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
locate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
lsattr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
lsb_release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
lsblk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
ltrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
md5sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
mdadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
mke2fs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
mkfs.cramfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
mkfs.exfat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
mkfs.fat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
mkfs.minix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
mkfs.ntfs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
mkfs.vfat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
nethogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
netstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
nm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
notify-send . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
pacman . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
pkgadd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
pkginfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
pkgmk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
pkgrm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
prt-get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
pvcreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
pwgen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
quotacheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
rdesktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
reboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
repquota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
12
rpm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
run-mailcap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
see . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
setfacl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
sha1sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
sha224sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
sha256sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
sha384sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
sha512sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
shuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
strace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
sysctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
systemctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
systemd-analyze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
tcpflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
timedatectl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
ufw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
ulimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
umask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
uname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
unexpand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
useradd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
userdel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
usermod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
vgcreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
whatis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
wpa_cli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
x11vnc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
xclip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
xdotool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
xeyes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
xinput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
xrandr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
xsel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
xsetwacom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
yaourt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
13
yum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
zypper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
3 OSX 251
airport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
archey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
base64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
brew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
caffeinate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
carthage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
dd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
diskutil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
ditto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
drutil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
du . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
head . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
hostname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
launchctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
locate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
look . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
md5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
mdfind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
netstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
networksetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
nm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
pbcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
pbpaste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
pmset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
pod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
qlmanage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
say . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
sed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
sw_vers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
sysctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
system_profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
systemsetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
14
uname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
w . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
wacaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
xattr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
xcodebuild . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
xctool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
xed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
xsltproc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
4 SUNOS 272
devfsadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
prctl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
prstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
svcadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
svccfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
svcs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
15
1 COMMON
7z
7z a archived.7z path/to/file
7z x archived
7z i
7z l archived
7za
7za x archived
16
– Archive using a specific archive type:
7za i
7za l archived
7zr
7zr x archived.7z
7zr l archived.7z
ab
ab -n 100 url
– Execute 100 HTTP GET requests, processing up to 10 requests concurrently, to given URL:
ab -n 100 -c 10 url
17
ack
ack foo
– Show the file names containing “foo” and number of matches in each file:
adb
– Check whether the adb server process is running and start it:
adb start-server
adb kill-server
adb shell
adb devices
18
ag
ag foo
– Find files containing “foo”, but only list the filenames:
ag -l foo
– Find files containing “FOO” case-insensitively, and print only the match, rather than the
whole line:
ag -i -o FOO
– Find “foo” in files with a name matching “bar”:
ag foo -G bar
– Find files whose contents match a regular expression:
ag '^ba(r|z)$'
– Find files with a name matching “foo”:
ag -g foo
alias
Creates aliases – words that are replaced by a command string. Aliases expire
with the current shell session, unless they’re defined in the shell’s configuration
file, e.g. ~/.bashrc.
– Create a generic alias:
alias word="command"
– View the command associated to a given alias:
alias word
– Remove an aliased command:
unalias word
– List all aliased words:
alias -p
– Turn rm into an interactive command:
19
ansible-playbook
ansible-playbook playbook
ansible
20
apg
apg
– Create a password with at least 1 symbol (S), 1 number (N), 1 uppercase (C), 1 lowercase
(L):
apg -M SNCL
apg -m 16
apg -x 16
– Create a password that doesn’t appear in a dictionary (the dictionary file has to be provided):
apg -r dictionary_file
apm
– Remove packages/themes:
– Upgrade packages/themes:
21
apropos
apropos regular_expression
apropos -l regular_expression
ar
ar -x libfoo.a
ar -t libfoo.a
ar -s libfoo.a
22
aria2c
Fast download utility. Supports HTTP(S), FTP, SFTP, BitTorrent, and Metalink.
aria2c url
aria2c -i filename
arp
arp -a
sudo arp -a -d
arp -d address
– Create an entry:
23
assimp
Command-line client for the Open Asset Import Library. Supports loading of
40+ 3D file formats, and exporting to several popular 3D formats.
assimp listext
assimp listexport
– Convert a file to one of the supported output formats, using the default parameters:
– Convert a file using custom parameters (the dox_cmd.h file in assimp’s source code lists
available parameters):
assimp help
atom
atom path/to/file_or_folder
atom -n path/to/file_or_folder
24
autojump
Quickly jump among the directories you visit the most. Aliases like j or jc are
provided for even less typing.
– Jump to a directory that contains the given pattern:
j pattern
– Jump to a sub-directory (child) of the current directory that contains the given pattern:
jc pattern
– Remove non-existing directories from the autojump database:
j --purge
– Show the entries in the autojump database:
j -s
autossh
– Run autossh in the background, with no monitoring port, no remote shell, exiting if the port
forward fails:
25
avrdude
avrdude -p \?
avrdude -c \?
awk
– Print the second column of the lines containing “something” in a space-separated file:
– Print the last column of each line in a file, using a comma (instead of space) as a field
separator:
– Sum the values in the first column of a file and print the total:
– Sum the values in the first column and pretty-print the values and then the total:
awk '{s+=$1; print $1} END {print "--------"; print s}' filename
26
aws s3
aws s3 ls bucket_name
aws s3 rm s3://bucket/path/to/file
axel
axel url
27
base32
base32 filename
– Decode a file:
base32 -d filename
somecommand | base32
somecommand | base32 -d
base64
base64 filename
– Decode a file:
base64 -d filename
somecommand | base64
somecommand | base64 -d
basename
basename path/to/file
– Show only the file name from a path, with a suffix removed:
28
bash
bash
– Execute a command:
bash -c "command"
bash file.sh
bash -s
– Print the version information of bash (use echo $BASH_VERSION to show just the version
string):
bash --version
bashmarks
s bookmark_name
– Go to a bookmarked folder:
g bookmark_name
p bookmark_name
– Delete a bookmark:
d bookmark_name
29
bc
Calculator.
– Run calculator in interactive mode using the standard math library:
bc -l
– Calculate the result of an expression:
bedtools
– Intersect two files with a left outer join, i.e. report each feature from {{file_1}} and NULL if
no overlap with {{file_2}}:
– Group file {{path/to/file}} based on the first three and the fifth column and summarize the
sixth column by summing it up:
30
bg
bg
bg job_id
blender
– Render all frames of an animation in the background, without loading the UI (output is saved
to /tmp):
blender -b filename.blend -a
– Render an animation using a specific image naming pattern, in a path relative (//) to the
.blend file:
– Render the 10th frame of an animation as a single image, saved to an existing folder (abso-
lute path):
– Render the second last frame in an animation as a JPEG image, saved to an existing folder
(relative path):
– Render the animation of a specific scene, starting at frame 10 and ending at frame 500:
– Start an interactive Blender session in the terminal with a python console (do import bpy
after starting):
blender -b --python-console
31
bmaptool
bower
bower install
bower list
bower init
32
bundle
– Install all gems defined in the gemfile expected in the working directory:
bundle install
– Update all gems by the rules defined in the gemfile and regenerate gemfile.lock:
bundle update
c99
c99 file.c
c99 -c file.c
– Compile source file(s), link with object file(s), and create an executable:
33
cabal
cabal init
cabal build
cabal test
cal
cal
cal -m month_number
cal -y
cal 2016
ncal -e year
34
calibre-server
calibre-server
calibredb
Tool to manipulate the your ebook database. Part of the Calibre ebook library.
calibredb list
– Remove one or more ebooks from the library. You need ebook-ids (see above):
35
cargo
Rust package manager. Manage Rust projects and their module dependencies
(crates).
– Install a crate:
cargo init
cargo build
cat
cat file
cat -n file
36
cd
cd path/to/directory
cd
cd ..
cd -
chgrp
37
chmod
– Give the [u]ser who owns a file the right to e[x]ecute it:
– Give [o]thers (not in the file owner’s group) the same rights as the group:
chown
38
chsh
cksum
Calculates CRC checksums and byte counts of a file. Note, on old UNIX systems
the CRC implementation may differ.
– Display a 32 bit checksum, size in bytes and filename:
cksum filename
clang
Compiler for C, C++, and Objective-C source files. Can be used as a drop-in
replacement for GCC.
– Compile a source code file into an executable binary:
cloc
Count, and compute differences of, lines of source code and comments.
– Count all the lines of code in a directory:
cloc /path/to/directory
– Count all the lines of code in a directory, displaying a progress bar during the counting
process:
39
cmp
– Find the byte number and line number of the first difference between the files:
column
Format standard input or file into multiple columns. Rows are filled before
columns; default separator is whitespace.
– Specify column delimiter character for the -t option (i.e. “,” for csv); default is whitespace:
comm
Select or reject lines common to two files. Both files must be sorted.
– Produce three tab-separated columns: lines only in first file, lines only in second file and
common lines:
40
– Print only lines common to both files, reading one file from stdin:
– Get lines only found in first file, saving the result to a third file:
– Print lines only found in second file, when the files aren’t sorted:
conda
conda list
41
consul-kv
consul
consul --version
consul --help
convert
– Scale an image keeping the original aspect ratio to a maximum dimension of 640x480:
42
convmv
– Convert filename encoding and rename the file to the new enconding:
cordova
cordova info
43
cowsay
cp
Copy files.
cp /path/to/original /path/to/copy
cp /path/to/original ../path/to/copy
cp -r /path/to/original /path/to/copy
cp file.html{,.backup}
cp file.{html,backup}
44
cpio
Copies files in and out of archives. Supports the following archive formats:
cpio’s custom binary, old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII,
old tar, and POSIX.1 tar.
– Take a list of file names from standard input and add them [o]nto an archive in cpio’s binary
format:
cppcheck
A static analysis tool for C/C++ code. Instead of syntax errors, it focuses on
the types of bugs that compilers normally do not detect.
– Recursively check the current folder, showing progress on the screen and logging error mes-
sages to a file:
cppcheck --enable=error|warning|style|performance|portability|information|all
path/to/file.cpp
– List available tests, filtered by a given search pattern:
cppcheck --project=path/to/project.sln
45
crontab
Schedule cron jobs to run on a time interval for the current user. Job def-
inition format: “(min) (hour) (day_of_month) (month) (day_of_week) com-
mand_to_execute”.
crontab -e
crontab -l
crontab -r
– Sample job which runs at 10:00 every day. * means any value:
0 10 * * * path/to/script.sh
* * 3 Apr * path/to/script.sh
30 2 * * Fri path/to/script.sh
csvclean
Finds and cleans common syntax errors in CSV files. Included in csvkit.
csvclean bad.csv
csvclean -n bad.csv
46
csvcut
Filter and truncate CSV files. Like Unix’s cut command, but for tabular data.
Included in csvkit.
csvcut -n data.csv
csvcut -C 4 data.csv
– Extract the columns named “id” and “first name” (in that order):
csvformat
csvformat -T data.csv
csvformat -U 0 data.csv
csvformat -U 1 data.csv
47
csvgrep
Filter CSV rows with string and pattern matching. Included in csvkit.
– Find rows in which the “name” column does NOT include the string “John Doe”:
csvlook
csvlook data.csv
csvpy
csvpy data.csv
48
csvsort
csvsort -c 9 data.csv
csvstat
Print descriptive statistics for all columns in a CSV file. Included in csvkit.
csvstat data.csv
49
curl
– Download a file saving the output under the filename indicated by the URL:
curl -O http://example.com/filename
curl -O -L -C - http://example.com/filename
– Send data, specifying a custom HTTP method, and including an extra header:
– Pass a user name and password for server authentication and show headers info only:
cut
cut -c 1-16
– Cut out the first sixteen characters of each line of the given files:
50
– Cut out everything from the 3rd character to the end of each line:
cut -c3-
– Cut out the fifth field of each line, using a colon as a field delimiter (default delimiter is tab):
– Cut out the 2nd and 10th fields of each line, using a semicolon as a delimiter:
– Cut out the fields 3 through 7 of each line, using a space as a delimiter:
deluser
– Remove a user:
deluser name
– Remove a user along with their home directory and mail spool:
deluser -r name
df
df
– Display all file systems and their disk usage in human readable form:
df -h
51
dhcpwn
diff
– Compare files:
52
dig
– Lookup the mail server associated with a given domain name (MX record):
dig -x 8.8.8.8
– Find authoritative name servers for the zone and display SOA records:
dirs
dirs
dirs -p
dirs +N
dirs -c
53
docker
docker ps
docker ps -a
– Start a container:
– Stop a container:
dokku
Docker powered mini-Heroku (PaaS). Easily deploy multiple apps to your server
in different languages using a single git-push command.
dokku apps
– Create an app:
– Remove an app:
– Install plugin:
54
drush
drush dl foo
– Download version 7.x-2.1-beta1 of module “foo”:
drush dl foo-7.x-2.1-beta1
– Enable module “foo”:
drush en foo
– Disable module “foo”:
drush cc all
– Clear CSS and JavaScript caches:
drush cc css-js
ebook-convert
Can be used to convert ebooks between common formats, e.g., pdf, epub and
mobi. Part of the Calibre ebook library tool.
– Convert an ebook into another format:
echo
55
ed
– Start ed, editing an empty document (which can be saved as a new file in the current direc-
tory):
ed
ed -p :
– Start ed editing an existing file (this shows the byte count of the loaded file):
ed -p : path/to/file
– Toggle the printing of error explanations. (By default, explanations are not printed and only
a ? appears):
– Add text to the current document. Mark completion by entering a period by itself in a new
line:
a<Enter>text_to_insert<Enter>.
– Print the entire document (, is a shortcut to the range 1,$ which covers the start to the end
of the document):
,p
– Write the current document to a new file (the filename can be omitted if ed was called with
an existing file):
w filename
– Quit ed:
56
electrum
electrum listaddresses -a
– Sign a message:
– Verify a message:
emacs
emacs -nw
emacs filename
– Exit emacs:
C-x C-c
57
enca
enca file(s)
– Detect file(s) encoding; -L option tells enca the current language; language is in the POSIX/C
locale format, e.g. zh_CN, en_US etc:
env
env
– Run a program. Often used in scripts after the shebang (#!) for looking up the path to the
program:
env program
env -i program
58
espeak
espeak -f filename
espeak -v voice
exiftool
59
fdupes
fdupes directory
fdupes -r directory
ffmpeg
ffmpeg -i video_filename -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3
ffmpeg -i in.avi -acodec libfaac -ab 128k -vcodec mpeg4 -b 1250K out.mp4
fg
fg
fg job_id
60
file
file filename
– Look inside a zipped file and determine the file type(s) inside:
file -z foo.zip
– Allow file to work with special or device files:
file -s filename
– Don’t stop at first file type match; keep going until the end of the file:
file -k filename
– Determine the mime encoding type of a file:
file -i filename
find
61
fold
Wraps each line in an input file to fit a specified width and prints it to the
standard output.
fold file
– Wrap each line to width “5” and break the line at spaces (puts each space separated word
in a new line, words with length > 5 are wrapped):
for
fortune
– Print a quotation:
fortune
fortune -o
fortune -l
62
– Print a short quotation:
fortune -s
fortune -f
– Print a quotation from one of the database files listed by fortune -f:
fortune filename
fsck
Check the integrity of a filesystem or repair it. The filesystem should be un-
mounted at the time the command is run.
fsck /dev/sda
– Check filesystem /dev/sda, reporting any damaged blocks and interactively letting the user
choose to repair each one:
fsck -r /dev/sda
– Check filesystem /dev/sda, reporting any damaged blocks and automatically repairing them:
fsck -a /dev/sda
fswatch
– Use {} in your bash command as a placeholder for the absolute path to the changed file:
63
fswebcam
– Take a picture:
fswebcam filename
ftp
ftp ftp.example.com
binary
prompt off
mget *.png
mput *.zip
mdelete *.txt
64
fuck
fuck
fzf
ps axu | fzf
fzf -q "query"
– Start finder on entries that start with core and end with either go, rb, or py:
– Start finder on entries that not match pyc and match exactly travis:
65
gcc
Preprocesses and compiles C and C++ source files, then assembles and links
them together.
gcc -S source.c
gcc -c source.c
gdb
– Debug an executable:
gdb executable
gdb -p procID
66
gem
Interact with the package manager for the Ruby programming language.
– Update a gem:
gem list
– Uninstall a gem:
ghc
The Glasgow Haskell Compiler. Compiles and links Haskell source files.
ghc Main
ghc file.hs
ghc -O file.hs
ghc -c file.hs
ghci
67
gifsicle
Create gifs.
git add
git add -A
git add -u
git add -f
68
git bisect
Use binary search to find the commit that introduced a bug. Git automatically
jumps back and forth in the commit graph to progressively narrow down the
faulty commit.
– Start a bisect session on a commit range bounded by a known buggy commit, and a known
clean (typically older) one:
– For each commit that git bisect selects, mark it as “bad” or “good” after testing it for the
issue:
– After git bisect pinpoints the faulty commit, end the bisect session and return to the
previous branch:
– Skip a commit during a bisect (e.g. one that fails the tests due to a different issue):
git blame
– Print file with author name and commit hash on each line:
– Print file with author email and commit hash on each line:
69
git branch
git branch
git branch -a
git checkout
git checkout .
– Replace a file in the current working directory with the version of it committed in a given
branch:
70
git cherry-pick
– Apply a range of commits to the current branch (see also git rebase --onto):
git clone
git clone -l
– Do it quietly:
git clone -q
– Clone an existing repository, and truncate to the specified number of revisions, save your
time mostly:
git commit
71
git config
git diff
git diff
– Output a summary of file creations, renames and mode changes since a given commit:
72
git fetch
– Fetch the latest changes from the default remote upstream repository (if set):
git fetch
– Delete local references to remote branches that have been deleted upstream:
git-imerge
– Continue imerge operation after resolving conflicts (git add the conflicted files, first):
73
git init
git init
git log
– Show the sequence of commits starting from the current one, in reverse chronological order:
git log
– Show all commits, tags and branches for the entire repo in a graph format:
git merge
Merge branches.
74
git mv
– Move file inside the repo and add the movement to the next commit:
git pull
git pull
– Download changes from default remote repository and use fast forward:
– Download changes from given remote repository and branch, then merge them into HEAD:
git push
git push
– Publish the current branch to a remote repository, setting the remote branch name:
75
git push remote_name -u remote_branch
– Send changes on all local branches to their counterparts in a given remote repository:
git rebase
– Rebase your local branch interactively with the latest changes in local master:
– Rebase your local branch interactively with the latest changes from upstream:
– Rebase your local branch by specifying new base commit and old base commit:
76
git remote
git remote -v
– Add a remote:
git reset
Undo commits or unstage changes, by resetting the current git HEAD to the
specified state. If a path is passed, it works as “unstage”; if a commit hash or
branch is passed, it works as “uncommit”.
– Unstage everything:
git reset
– Unstage specific file(s):
77
git rm
git rm file
– Remove directory:
git rm -r directory
git stash
git stash -u
git stash -p
– List all stashes (shows stash name, related branch and message):
– Apply a stash (default is stash@{0}), and remove it from the stash list if applying doesn’t
cause conflicts:
78
git status
git status
git status -s
git submodule
git svn
– Fetch updates from the remote SVN repository without changing the git HEAD:
79
git tag
Create, list, delete or verify tags. A tag is a static reference to a specific commit.
git tag
– Create a tag with the given name pointing to the current commit:
git worktree
– Create a new folder with the specified branch checked out into it:
– Create a new folder with a new branch checked out into it:
80
git
git --version
git --help
git command
gitsome
– Enter the gitsome shell (optional), to enable autocompletion and interactive help for git (and
gh) commands:
gitsome
gh configure
– List notifications for the current account (as would be seen in https://github.com/notifications):
gh notifications
– List the current account’s starred repos, filtered by a given search string:
gh feed tldr-pages/tldr
– View the recent activity feed for a given GitHub user, using the default pager (e.g. less):
gh feed torvalds -p
81
glances
– Run in terminal:
glances
glances -w
glances -s
glances -c hostname
glances -s --password
go
go get package_path
– Compile and run a source file (it has to contain a main package):
go run file.go
go build
– Execute all test cases of the current package (files have to end with _test.go):
go test
go install
82
gource
Renders an animated tree diagram of Git, SVN, Mercurial and Bazaar repos-
itories. It shows files and folders being created, modified or removed over
time.
– Run gource in a directory (if it isn’t the repository’s root directory, the root is seeked up from
there):
gource path/to/repository
gource -widthxheight
gource -c time_scale_multiplier
– Set how long each day should be in the animation (this combines with -c, if provided):
gource -s seconds
gource -f -b hex_color_code
gpg
83
– Decrypt doc.txt.gpg (output to STDOUT):
gradle
– Compile a package:
gradle build
gradle clean
gradle assembleRelease
grep
Matches patterns in input text. Supports simple patterns and regular expres-
sions.
84
– Search recursively (ignoring non-text files) in current directory for an exact string:
grep -v search_string
gulp
JavaScript task runner and streaming build system. Tasks are defined within
gulpfile.js at the project root.
gulp
85
gunzip
gunzip archive.tar.gz
gunzip -l file.txt.gz
gzip
gzip file.ext
gzip -d file.ext.gz
– Specify the compression level. 1=Fastest (Worst), 9=Slowest (Best), Default level is 6:
86
handbrakecli
– Convert a video file to MKV (AAC 160kbit audio and x264 CRF20 video):
handbrakecli --preset-list
haxelib
haxelib upgrade
87
heroku
heroku login
heroku create
history
history
– Clear the commands history list (only for current bash shell):
history -c
– Overwrite history file with history of current bash shell (often combined with history -c to
purge history):
history -w
88
hn
hn
hn --limit number
– View stories on Hacker News, and keep the list open after selecting a link:
hn --keep-open
hn --latest
host
host domain
host ip_address
89
htpasswd
Create and manage htpasswd files to protect web server directories using basic
authentication.
– Create/overwrite htpasswd file:
http
http -d example.org
– Send form-encoded data:
90
hub
A wrapper for git that adds commands for working with github-based projects.
The commands can also be used using “git” instead of “hub”.
– Clone a repository you own, using just the repository name rather than the full URL:
– Clone another user’s repository, using their github username and the repository name:
– Create a fork of the current repository (cloned from another user) under your github profile:
hub fork
– Create a PR of the current branch in the original repository (after pushing the branch to
github):
hub pull-request
hub create
iconv
iconv -l
91
id
id -u
id -g
if
– Full if syntax:
ifconfig
ifconfig eth0
ifconfig -a
ifconfig eth0 up
92
import
Capture some or all of an X server screen and save the image to a file. Part of
ImageMagick library.
in2csv
in2csv data.xls
93
inkscape
An SVG (Scalable Vector Graphics) editing program. Use -z to not open the
GUI and only process files in the console.
– Open an SVG file in the Inkscape GUI:
inkscape filename.svg
– Export an SVG file into a bitmap with the default format (PNG) and the default resolution
(90 DPI):
install
Copy files and set attributes. Copy files (often executable) to a system location
like /usr/local/bin, give them the appropriate permissions/ownership.
– Copy files to destination:
94
ionice
Get or set program I/O scheduling class and priority. Scheduling classes: 1
(realtime), 2 (best-effort), 3 (idle). Priority levels: 0 (the highest) - 7 (the
lowest).
– Set I/O scheduling class of a running process:
ionice -p pid
ioping
ioping .
ioping -c 10 -s 1M /tmp
ioping -R /dev/sda
ipcs
ipcs -a
95
jar
java
– Execute a java .class file that contains a main method by using just the class name:
java filename
java -version
javac
javac filename.java
javac *.java
– Compile a .java file and place the resulting class file in a specific directory:
96
jhat
jhat dump_file.bin
– Analyze a heap dump, specifying an alternate port for the http server:
jmap
jmap java_pid
– Print heap summary information:
jobs
jobs
– Show status of a particular job:
jobs job_id
– Show status and process IDs of all jobs:
jobs -l
– Show process IDs of all jobs:
jobs -p
97
jq
cat file | jq
– Output all elements from JSON array in file, or all key-value pairs from JSON objects in file:
– Read JSON objects from file, into array, and output (inverse of jq .[]):
jstack
jstack java_pid
– Print mixed mode (java/c++) stack traces for all threads in a java process:
jstack -m java_pid
98
julia
julia
julia program.jl
julia -e 'julia_code'
julia -p N
kill
Sends a signal to a process, usually related to stopping the process. All signals
except for SIGKILL and SIGSTOP can be intercepted by the process to perform
a clean exit.
kill process_id
– List available signal names (to be used without the SIG prefix):
kill -l
– Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead
of terminating:
99
kill -1|HUP process_id
– Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the
user pressing Ctrl+C:
– Signal the operating system to immediately terminate a program (which gets no chance to
capture the signal):
– Signal the operating system to pause a program, it until a SIGCONT (“continue”) signal is
received:
last
– View last logins, their duration and other information as read from /var/log/wtmp:
last
last -n login_count
last -F
last user_name
– View the last reboot (last login of the pseudo user reboot):
last reboot
– View the last shutdown (last login of the pseudo user shutdown):
last shutdown
100
latexmk
Compile LaTeX source files into finished documents. Automatically does multi-
ple runs when needed.
latexmk
latexmk source.tex
latexmk -c
latexmk -c source.tex
latexmk -C
less
– Open a file:
less source_file
G (end), g (start)
101
/something
?something
– Exit:
license
– Print a license to stdout, using the defaults (auto-detected author name, and current year):
license license_name
license ls
ln
ln -s path/to/file path/to/symlink
ln path/to/file path/to/hardlink
102
logstash
An ETL (extract, transform and load) tool. Commonly used to load data from
various sources, like databases and log files, into elasticsearch.
lp
Print files.
– Print the output of a command to the default printer (see lpstat command):
echo "test" | lp
lp path/to/filename
lp -d printer_name path/to/filename
– Print N copies of file to default printer (replace N with desired number of copies):
lp -n N path/to/filename
– Print only certain pages to the default printer (print pages 1, 3-5, and 16):
lp -P 1,3-5,16 path/to/filename
103
lpstat
– List printers present on the machine and whether they are enabled for printing:
lpstat -p
lpstat -d
lpstat -t
lpstat -u user
ls
ls -1
ls -a
– Long format list (permissions, ownership, size and modification date) of all files:
ls -la
– Long format list with size displayed using human readable units (KB, MB, GB):
ls -lh
ls -lS
– Long format list of all files, sorted by modification date (oldest first):
ls -ltr
104
lsof
Lists open files and the corresponding processes. Note: In most cases, you
need root privilege (or use sudo) because you want to list files opened by
others.
– Find the processes that have a given file open:
lsof /path/to/file
– Find the process that opened a local internet port:
lsof -i :port
– Only output the process PID:
lsof -t /path/to/file
– List files opened by the given user:
lsof -u username
– List files opened by the given command or process:
lsof -c process_or_command_name
– List files opened by the given PID:
lsof -p PID
lwp-request
105
mailx
– To send mail, the content is typed after the command and ended with Control-D:
make
Task runner for targets described in Makefile. Mostly used to control the com-
pilation of an executable from source code.
– Call the first target specified in the Makefile (usually named “all”):
make
make target
106
man
man command
man --path
man -w command
man -k keyword
mdp
mdp presentation.md
107
meshlabserver
– Convert a WRL file to a OFF file, including the vertex and face normals in the output mesh:
meshlabserver -d filename
– Process a 3D file using a filter script created in the MeshLab GUI (Filters > Show current
filter script > Save Script):
– Process a 3D file using a filter script, writing the output of the filters into a log file:
meteor
meteor
meteor list
– Create a production build of the project as a tarball under the given directory:
108
mitmdump
mitmdump -w filename
mitmproxy
mitmproxy
mkdir
Creates a directory.
mkdir directory
mkdir -p path/to/directory
109
mkfifo
mkfifo path/to/pipe
mmv
mocha
mocha
mocha folder/with/tests
– Run tests on changes to JavaScript files in the current directory and once initially:
mocha --watch
110
mongo
– Connect to a database:
mongo database
– Connect to a database with a given username; user will be prompted for password:
mongodump
– Create a dump of all databases (this will place the files inside a folder called “dump”):
mongodump
– Create a dump of a given database with a given username; user will be prompted for pass-
word:
111
mongorestore
– Import a bson data dump from a folder to a given database in a MongoDB server host,
running at a given port, with user authentication (user will be prompted for password):
– Import a collection from a bson file to a given database in a MongoDB server host, running
at a given port, with user authentication (user will be prompted for password):
montage
– Tile images into a grid, automatically calculating the grid cell size from the largest image:
– Set the grid cell size and resize images to fit it before tiling:
– Limit the number of rows and columns in the grid, causing input images to overflow into
multiple output montages:
– Resize and crop images to completely fill their grid cells before tiling:
112
more
Open a file for interactive reading, allowing scrolling and search (in forward
direction only).
– Open a file:
more source_file
– Page down:
<Space>
/something
– Exit:
mount
mount
mount -a
– Mount a specific filesystem described in /etc/fstab (e.g. “/dev/sda1 /my_drive ext2 defaults
0 2”):
mount /my_drive
113
mp4box
mpc
Music Player Client. Program for controlling the Music Player Daemon (MPD).
– Toggle play/pause:
mpc toggle
– Stop playing:
mpc stop
mpc status
mpc next
mpc prev
mpc [+-]seconds
114
msmtp
An SMTP client. It reads text from standard input and sends it to an SMTP
server.
– Send an email without a configured account. The password should be specified in the ~/.
msmtprc file:
mtr
mtr host
mtr -n host
mtr -w host
mtr -4 host
115
mv
mv source target
mv -f source target
– Do not prompt for confirmation before overwriting existing files but write to standard error
before overriding:
– Move files in verbose mode, showing files after they are moved:
mv -v source target
mysql
– Connect to a database:
mysql database_name
116
mysqldump
nano
nano filename
nano -S filename
nano -i filename
nc
nc -l port
nc ip_address port
– Set a timeout:
– Serve a file:
117
nc -l port < file
– Receive a file:
nc -k -l port
nc -q timeout ip_address
– Port scanning:
nc -v -z ip_address port
nginx
nginx
nginx -c config_file
– Start server with a prefix for all relative paths in config file:
nginx -t
nginx -s reload
118
ngrep
ngrep -d any
ngrep -d eth0
nice
nix-env
nix-env -qas
119
– Install package:
nix-env -i pkg_name
– Uninstall package:
nix-env -e pkg_name
nix-env -u pkg_name
nix-env -u
nmap
Network exploration tool and security / port scanner. Some features only acti-
vate when Nmap is run with privileges.
– Try to determine whether the specified hosts are up and what are their names:
– Like above, but also run a default 1000-port TCP scan if host seems up:
nmap -A address_or_addresses
– Scan a specific list of ports (use -p- for all ports 1-65535):
– Perform TCP and UDP scanning (use -sU for UDP only, -sZ for SCTP, -sO for IP):
120
node
node file.js
node
node -e "code"
nohup
npm
JavaScript and Node.js package manager. Manage Node.js projects and their
module dependencies.
npm install
– Download a given dependency required for the application to run, and add it to the pack-
age.json:
– Download a given dependency for development purposes, and add it to the package.json:
121
– Uninstall a module:
npm list
npm init
nslookup
– Query your system’s default name server for an IP address (A record) of the domain:
nslookup example.com
– Query a given name server for the whole zone file (zone transfer) of the domain using TCP
protocol:
– Query for a mail server (MX record) of the domain, showing details of the transaction:
– Query a given name server on a specific port number for a TXT record of the domain:
122
nvm
– List all available NodeJS versions and print the default one:
nvm list
odps auth
123
create role role_name;
– Grant a set of authorities to a role:
odps func
list functions;
– Create a Java function using a .jar resource:
odps inst
show instances;
– Describe the details of an instance:
status instance_id;
– Wait on the termination of an instance, printing log and progress information until then:
wait instance_id;
– Kill an instance:
kill instance_id;
124
odps resource
list resources;
add py script.py;
– Delete resource:
odps table
create table table_name (col type) partitioned by (col type) lifecycle days;
– Delete table:
125
odps tunnel
odps
odpscmd --config=odps_config.ini
use project_name;
show tables;
– Describe a table:
desc table_name;
– Describe a partition:
126
openssl
– Generate a self-signed certificate from a certificate signing request valid for some number
of days:
openssl x509 -req -days days -in filename.csr -signkey filename.key -out filename
.crt
optipng
optipng file.png
optipng -i 1 file.png
127
pandoc
– Convert file to pdf (the output format is automatically determined from the output file’s
extension):
– Convert a file to a specific output format (useful for when the extension alone is ambiguous):
pandoc --list-input-formats
pandoc --list-output-formats
parallel
– Break stdin into ~1M blocks, feed each block to stdin of new command:
128
pass
Safely store and read passwords or other sensitive data easily. All data is
GPG-encrypted, and managed with a git repository.
– Save a new password (prompts you for the value without echoing it):
pass -c path/to/data
pass
– Generate a new random password with a given length, and copy it to the clipboard:
passwd
passwd -S
– Make the password of the account blank (it will set the named account passwordless):
passwd -d
129
paste
– Join all the lines into a single line, using TAB as delimiter:
paste -s file
– Join all the lines into a single line, using the specified delimiter:
– Merge two files side by side, each in its column, using TAB as delimiter:
– Merge two files side by side, each in its column, using the specified delimiter:
patch
Patch a file (or files) with a diff file. Note that diff files contain both the target
filenames and list of changes.
– Apply a patch:
130
pdflatex
pdflatex source.tex
pdftk
PDF toolkit.
– Extract pages 1-3, 5 and 6-10 from a PDF file and save them as another one:
– Merge (concatenate) a list of PDF files and save the result as another one:
– Split each page of a PDF file into a separate file, with a given filename output pattern:
131
perl
perl script.pl
perl -c script.pl
perl -e perl_statement
perl -d script.pl
pg_dump
132
pg_restore
pgrep
pgrep process_name
– Search full command line with parameters instead of just the process name:
133
php
php file
– Check syntax on (i.e. lint) a PHP script:
php -l file
– Run PHP interactively:
php -a
– Run PHP code (Notes: Don’t use <? ?> tags; escape double quotes with backslash):
php -r "code"
– Start a PHP built-in web server in the current directory:
php -S host:port
phpize
phpize
– Delete files previously created by phpize:
phpize --clean
phpunit
phpunit
– Run tests in a specific file:
phpunit path/to/TestFile.php
– Run tests annotated with the given group:
134
pigz
pigz filename
pigz -9 filename
– Decompress a file:
pigz -d archive.gz
pigz -l archive.tar.gz
ping
– Ping host:
ping host
– Ping host, specifying the interval in seconds between requests (default is 1 second):
ping -n host
– Ping host and ring the bell when a packet is received (if your terminal supports it):
ping -a host
135
pip
– Install a package:
– Upgrade a package:
– Uninstall a package:
pkill
pkill -9 process_name
– Kill all processes which match their full command instead of just the process name:
pkill -9 -f "command_name"
136
play
Audio player of SoX - Sound eXchange. Plays any audio from the command
line, with audio formats identified by the extension.
play audiofile
pngcrush
– Compress PNG file with all 114 available algorithms and pick the best result:
137
printf
printf "\e[1;34m%.3d\e[0m\n" 42
ps
ps aux
ps auxww
138
psql
– Connect to database. It connects to localhost using default port 5432 with default user as
currently logged in user:
psql database
– Connect to database on given server host running on given port with given username, without
a password prompt:
– Execute a single SQL query or PostgreSQL command on the given database (useful in shell
scripts):
pushd
pushd
– Rotate stack by making the 5th element the top of the stack:
pushd +4
139
pv
pv file
– Measure the speed and amount of data flow between pipes (-s is optional):
– Attach to an already running process and see its file reading progress:
pv -d PID
– Stop reading after reading specified amount of data, rate limit to 1K/s:
pv -L 1K -S maximum_file_size_to_be_read
pwd
pwd
– Print the current directory, and resolve all symlinks (i.e. show the “physical” path):
pwd -P
140
pyenv
pyenv commands
pyenv versions
– Set Python version to be used in the current directory and all directories below it:
python
python
python script.py
python -c command
141
q
– Read data from stdin; ‘-’ in the query represents the data from stdin:
– Join two files (aliased as f1 and f2 in the example) on column c1, a common column:
– Format output using an output delimeter with an output header line (note: command will
output column names based on the input file header or the column aliases overridden in the
query):
qemu-img
Tool for Quick Emulator Virtual HDD image creation and manipulation.
– Dump the allocation state of every sector of the specified disk image:
142
qemu
– Boot from physical device (e.g. from USB to test bootable medium):
quota
quota
quota -v
– Quiet output (only display quotas on filesystems where usage is over quota):
quota -q
– Print quotas for the groups of which the current user is a member:
quota -g
143
read
read variable
read -a array
– Enable backspace and GNU readline hotkeys when entering input with read:
read -e variable
readlink
readlink filename
readlink -f filename
144
redis-cli
redis-cli
redis-cli -h host
– Specify a password:
redis-cli -a password
redis-cli redis_command
redshift
– Turn on Redshift with 5700K temperature during day and 3600K at night:
redshift -t 5700:3600
redshift -l latitude:longitude
– Turn on Redshift with 70% screen brightness during day and 40% brightness at night:
redshift -b 0.7:0.4
redshift -g red:green:blue
redshift -O temperature
145
rename
– Rename files using a Perl Common Regular Expression (substitute ‘foo’ with ‘bar’ wherever
found):
rename 's/foo/bar/' \*
rename -n 's/foo/bar/' \*
rename -f 's/foo/bar/' \*
rename 'y/A-Z/a-z/' \*
rename 's/\s+/_/g' \*
renice
146
rev
rev file
ripgrep
rg pattern
rg -uu pattern
– Search for a pattern only in a certain filetype (e.g., html, css, etc.):
rg -t filetype pattern
rg pattern set_of_subdirs
rg pattern -g glob
147
rm
rm path/to/file path/to/another/file
rm -r path/to/folder
– Forcibly remove a directory, without prompting for confirmation or showing error messages:
rm -rf path/to/folder
rm -i file(s)
– Remove files in verbose mode, printing a message for each removed file:
rm -v path/to/folder/*
rmdir
Removes a directory.
– Remove directory, provided it is empty. Use rm to remove not empty directories:
rmdir path/to/directory
rmdir -p path/to/directory
route
route -n
148
rsync
Transfer files either to or from a remote host (not between two remote hosts).
Can transfer single files, or multiple files matching a pattern.
– Transfer file from local to remote host:
rtv
Reddit Terminal Viewer. Use arrow keys to navigate. Right and Left to view
and return from a submission, respectively.
– Open the front page:
/front
– Open a subreddit:
/r/subreddit_name
– Expand/collapse comments:
[space]
– Open link:
o
– Login:
u
– Open the help screen:
149
rustc
The Rust compiler. Processes, compiles and links Rust language source files.
rustc file.rs
rustc -O file.rs
rustc -g file.rs
sails
– Start Sails:
sails lift
150
salt-key
salt-call state.highstate
– Perform a highstate dry-run, compute all changes but don’t actually perform them:
salt-call grains.items
salt-key
Manages salt minion keys on the salt master. Needs to be run on the salt
master, likely as root or with sudo.
salt-key -L
salt-key -a MINION_ID
salt-key -r MINION_ID
salt-key -F
151
salt-run
salt-run manage.status
salt-run manage.up
salt
– Upgrade packages using the OS package manager (apt, yum, brew) on a subset of minions:
samtools
Tools for handling high-throughput sequencing (genomics) data. Used for read-
ing/writing/editing/indexing/viewing of data in SAM/BAM/CRAM format.
– Take input from stdin (-) and print the SAM header and any reads overlapping a specific
region to stdout:
152
– Sort file and save to BAM (the output format is automatically determined from the output
file’s extension):
sass
– Convert a SCSS or Sass file to CSS and print out the result:
sass inputfile.scss|inputfile.sass
– Convert a SCSS or Sass file to CSS and save the result to a file:
– Watch a SCSS or Sass file for changes and output or update the CSS file with same filename:
– Watch a SCSS or Sass file for changes and output or update the CSS file with the given
filename:
153
scp
Secure copy. Copy files between hosts using Secure Copy Protocol over SSH.
– Copy a local file to a remote host:
scrapy
Web-crawling framework.
– Create a project:
154
screen
Hold a session open on a remote server. Manage multiple windows with a single
SSH connection.
– Start a new screen session:
screen
screen -S session_name
– Start a new deamon and log the output to screenlog.x:
screen -ls
– Reattach to an open screen:
screen -r session_name
– Detach from inside a screen:
ctrl+A D
– Kill a detached screen:
screenfetch
screenfetch
screenfetch -s
– Specify distribution logo:
screenfetch -A 'distribution_name'
screenfetch -D 'distribution_name'
– Strip all color:
screenfetch -N
155
sed
– Replace the first occurrence of a string in a file, and print the result:
– Replace all occurrences of a string in a file, overwriting the file (i.e. in-place):
– Replace separator / by any other character not used in the find or replace patterns, e.g., #:
sendmail
– Send a message with the content of message.txt to the mail folder of local user user_name:
– Send an email from [email protected] (assuming your local mail server is configured
for this) to [email protected] containing the message in message.txt:
– Send an email from [email protected] (assuming your local mail server is configured
for this) to [email protected] containing the file file.zip:
156
seq
seq 10
seq 5 3 20
sftp
Secure File Transfer Program. Interactive program to copy files between hosts
over SSH. For non-interactive file transfers, see scp or rsync.
sftp remote_user@remote_host
get /path/remote_file
put /path/local_file
– Transfer remote folder to the local system recursively (works with put too):
get -R /path/remote_folder
lls
ls
157
sh
sh
– Execute a command:
sh -c command
sh file.sh
sh -s
shopt
Manage Bash shell options: variables (stored in $BASHOPTS) that control be-
havior specific to the Bash shell. Generic POSIX shell variables (stored in
$SHELLOPTS) are managed with the set command instead.
shopt
– Set an option:
shopt -s option_name
– Unset an option:
shopt -u option_name
– Print a list of all options and their status formatted as runnable shopt commands:
shopt -p
help shopt
158
shred
– Overwrite a file:
shred file
skicka
– List files:
skicka ls path/to/folder
skicka du path/to/parent/folder
– Create a folder:
– Delete a file:
skicka rm path/to/file
159
sl
sl
sl -a
sl -F
slackcat
sleep
sleep seconds
– Delay in minutes:
sleep minutesm
– Delay in hours:
sleep hoursh
160
socat
– Listen to a port, wait for an incoming connection and transfer data to STDIO:
socat - TCP-LISTEN:8080,fork
– Create a connection to a host and port, transfer data in STDIO to connected host:
socat - TCP4:www.domain.com:80
sort
sort filename
sort -r filename
sort -n filename
sort -u filename
161
sox
Sound eXchange: play, record and convert audio files. Audio formats are iden-
tified by the extension.
– Normalize an audio file (adjust volume to the maximum peak level, without clipping):
split
– Split a file, each split having 10 lines (except the last split):
split -l 10 filename
– Split a file into 5 files. File is split such that each split has same size (except the last split):
split -n 5 filename
162
srm
Securely remove files or directories. Overwrites the existing data one or mul-
tiple times. Drop in replacement for rm.
srm -s /path/to/file
srm -m /path/to/file
– Recursively remove a directory and its contents overwriting each file with a single-pass of
random data:
srm -r -s /path/to/folder
srm -i \*
ssh-copy-id
ssh-copy-id username@remote_host
– Copy the given public key to the remote with specific port:
163
ssh-keygen
Generate ssh keys user for authentication, password-less logins, and other
things.
ssh-keygen
ssh-keygen -f ~/.ssh/filename
ssh-keygen -t dsa
– Retrieve the key fingerprint from a host (useful for confirming the authenticity of the host
when first connecting to it via SSH):
ssh-keygen -l -F remote_host
ssh-keygen -p -f ~/.ssh/filename
ssh
Secure Shell is a protocol used to securely log onto remote systems. It can be
used for logging or executing commands on a remote server.
ssh username@remote_host
164
– Connect to a remote server using a specific port:
– Enable the option to forward the authentication information to the remote machine (see
man ssh_config for available options):
sshfs
fusermount -u mountpoint
– Use compression:
sshfs username@remote_host:remote_directory -C
165
st-flash
st-flash erase
st-info
st-info --flash
st-info --sram
st-info --probe
st-util
Run GDB (GNU Debugger) server to interact with STM32 ARM Cortex micro-
contoller.
st-util -p 4500
166
strings
strings file
strings -t d file
– Prefix each result with its offset within the file in hexadecimal:
strings -t x file
su
su username
su
su - username
subliminal
167
sudo
sudo ls /usr/local/scrt
sudo !!
sum
Compute checksums and the number of blocks for a file. A predecessor to the
more modern cksum.
sum file
supervisorctl
– Start/stop/restart a process:
168
supervisorctl start|stop|restart group_name:*
supervisorctl update
supervisord
supervisord -c path/to/file
supervisord -n
svn
svn co url/to/repository
svn up
– Put files and directories under version control, scheduling them for addition to repository.
They will be added in next commit:
svn help
169
tabula
– Extract tables from page 1 of a PDF, guessing which portion of the page to examine:
– Extract all tables from a PDF, using ruling lines to determine cell boundaries:
– Extract all tables from a PDF, using blank space to determine cell boundaries:
tac
tac file1
170
tail
tail -f file
tar
– Create a compressed archive, using archive suffix to determine the compression program:
171
task
– List tasks:
task list
– Modify task:
– Delete task:
tcpdump
tcpdump -i eth0
tcpdump -A tcp
– Capture the traffic from a specific interface, source, destination and destination port:
tcpdump -i eth0 src 192.168.1.1 and dst 192.168.1.2 and dst port 80
– Capture all traffic except traffic over port 22 and save to a dump file:
172
tee
Read from standard input and write to standard output and files.
telnet
quit
CTRL + ]
tesseract
– Recognize text in an image and save it to output.txt. The file extension MUST not be
mentioned:
– Specify a custom language (default is English) with an ISO 639-2 code (e.g. deu = Deutsch
= German):
173
– List the ISO 639-2 codes of available languages:
tesseract --list-langs
tesseract --help-psm
test
test -z $GIT_BRANCH
test -e filename
test ! -d path/to/directory
– If-else statement:
time
– Time “ls”:
time ls
174
tldr
– Get typical usages of a command (hint: this is how you got here!):
tldr command
tldr --update
tldrl
tldrl pages_directory
tldrl -f page.md
tmux
tmux
– List sessions:
tmux ls
– Attach to a session:
175
tmux a
tmux a -t name
ctrl+b d
– Kill session:
touch
touch filename
– Use the times from a file to set the times on a second file:
tput
tput cols|lines|colors
tput bel
tput sgr0
176
tr
– Map each character of the first set to the corresponding character of the second set:
– Delete all occurances of the specified set of characters from the input:
tr -d 'input_characters'
tr -s '\n'
– Strip out non-printable characters from the file and print result:
traceroute
– Traceroute to a host:
traceroute host
traceroute -n host
traceroute -q 5 host
traceroute host 42
177
transcode
Transcode video and audio codecs, and convert between media formats.
– Remove camera shakes after creating stabilisation file, transform video using xvid:
– Resize the video to 640x480 pixels and convert to MPEG4 codec using xvid:
tty
tty
ufraw-batch
– Save the file with size up to the given maximums MAX1 and MAX2:
178
umount
– Unmount a filesystem:
umount path/to/device_file
– OR:
umount path/to/mounted_directory
umount -a
unar
unar archive
unar -f archive
unar -r archive
unar -s archive
179
uniq
Output the unique lines from the given input or file. Since it does not detect
repeated lines unless they are adjacent, we need to sort them first.
unrar
unrar x compressed.rar
– Extract files into current directory, losing directory structure in the archive:
unrar e compressed.rar
unrar t compressed.rar
unrar l compressed.rar
180
unzip
– Extract zip file(s) (for multiple files, seperate file paths by spaces):
unzip file(s)
unzip -l file
uptime
Tell how long the system has been running and other information.
– Print current time, uptime, number of logged-in users and other information:
uptime
vagrant
vagrant init
– Create Vagrantfile with the Ubuntu 14.04 (Trusty Tahr) box from HashiCorp Atlas:
vagrant up
vagrant suspend
vagrant ssh
181
vim
– Open a file:
vim file
<Esc>i
– Copy (“yank”) or cut (“delete”) the current line (paste it with P):
<Esc>yy|dd
<Esc>u
<Esc>/search_pattern<Enter>
– Perform a regex substitution in the whole file (from the start, 1, to the end, $):
<Esc>:1,$s/pattern/replacement/g<Enter>
<Esc>:wq<Enter>
<Esc>:q!<Enter>
vimtutor
– Launch the vim tutor using the given language (en, fr, de, …):
vimtutor language
<Esc> :q <Enter>
182
virtualenv
virtualenv path/to/venv
source path/to/venv/bin/activate
deactivate
visudo
sudo visudo
sudo visudo -c
vue-cli
Simple CLI for scaffolding Vue.js projects. Official templates include: webpack,
webpack-simple, browserify, browserify-simple, simple.
183
w
Show who is logged on and what they are doing. Print user login, TTY, remote
host, login time, idle time, current process.
– Show logged-in users info:
w
– Show logged-in users info without a header:
w -h
w3m
w3m http://example.com
– Quit w3m:
wait
wait pid
– Wait for all processes known to the invoking shell to finish:
wait
watch
watch command
– Re-run a command every 60 seconds:
watch -n 60 command
– Monitor the contents of a directory, highlighting differences as they appear:
watch -d ls -l
184
wc
wc -l file
wc -w file
wc -c file
wc -m file
webpack
Bundle a web project’s js files and other assets into a single output file.
– Load css files too from the js file (this uses the css loader for .css files):
– Pass a config file (with eg. the entry script and the output filename) and show compilation
progress:
185
wget
Download files from the Web. Supports HTTP, HTTPS, and FTP.
– Download the contents of an URL to a file:
wget -c url
which
which executable
which -a executable
while
186
who
– Display the username, line, and time of all currently logged-in sessions:
who
who am i
who -a
who -a -H
whoami
whoami
x_x
x_x file.xlsx|file.csv
– View an XLSX or CSV file, using the first row as table headers:
x_x -h 0 file.xlsx|file.csv
187
xargs
– Convert newlines in the input into NUL (\0) characters, and split on those only (useful if the
input to xargs contains spaces):
– Execute the command once for each input line, replacing any occurrences of the placeholder
(here marked as _) with the input line:
xcv
– Cut a file:
xcv x input_file
– Copy a file:
xcv c input_file
– Paste a file:
xcv v output_file
xcv l
188
xz
xz file
– Decompress a file:
xz -d file.xz
xz -dc file.xz
xz -k file
xz -0 file
xz -9 file
yarn
yarn
– Install a module and save it as a dependency to the package.json file (add –dev to save as
a dev dependency):
yarn init
– Identify whether a module is a dependency and list other modules that depend upon it:
189
yes
yes message
yes
youtube-dl
youtube-dl https://www.youtube.com/watch?v=oHg5SJYRHA0
– Download a video and save its description, metadata, annotations, subtitles, and thumbnail:
– From a playlist, download all “Let’s Play” videos that aren’t marked “NSFW” or age-restricted
for 7 year-olds:
zbarimg
zbarimg image_file
190
zcat
zcat file.txt.gz
zdb
ZFS debugger.
– Show detailed configuration of all mounted ZFS zpools:
zdb
zdb -C poolname
zdb -b poolname
zfs
zfs list
191
zip
zless
zless file.txt.gz
zpool
zpool status
– Check a ZFS pool for errors (verifies the checksum of EVERY block). Very CPU and disk
intensive:
192
– List zpools available for import:
zpool import
– Import a zpool:
zsh
zsh
zsh -c command
zsh file
– Run commands from file and print them as they are executed:
zsh -x file
193
2 LINUX
adduser
adduser name
– Create a new user without a home directory:
apt-cache
194
apt-get
apt-get update
– Remove a package:
apt-get upgrade
apt-get autoremove
– Upgrade installed packages (like “upgrade”), but remove obsolete packages and install ad-
ditional packages to meet new dependencies:
apt-get dist-upgrade
apt-key
Key management utility for the APT Package Manager on Debian and Ubuntu.
– List trusted keys:
apt-key list
195
apt
– Update list of packages and versions available. This should be run before running further
apt commands:
apt update
– Remove a package (using “purge” instead also removes its configuration files):
apt upgrade
apt autoremove
apt full-upgrade
aptitude
– Synchronize list of packages and versions available. This should be run first, before running
subsequent aptitude commands:
aptitude update
196
– Search for a package:
aptitude upgrade
– Upgrade installed packages (like aptitude upgrade) including removing obsolete packages
and installing additional packages to meet new package dependencies:
aptitude full-upgrade
archey
archey
at
– Open an at prompt to create a new set of scheduled commands, press Ctrl+D to save and
exit:
at hh:mm:ss
– Execute the commands and email the result using a local mailing program such as sendmail:
at hh:mm:ss -m
at hh:mm:ss -f path/to/file
197
beep
beep
– Play a beep that repeats:
beep -r repetitions
– Play a beep at a specified frequency (Hz) and duration (milliseconds):
brew
brew list
– Get latest version of installed formula (passing no formula updates all installed formulae):
brew update
– Display information about formula, which contains formula version, installed path, depen-
dencies, etc.:
brew doctor
198
bzip2
– Compress file:
bzip2 path/to/file_to_compress
– Decompress file:
bzip2 -d path/to/compressed_file.bz2
– Decompress to console:
chattr
chattr +i path
chattr -i path
chattr -R +i folder
chroot
chroot --userspec=user:group
199
cmus
cmus path/to/directory
– Add file/directory to library:
:add path/to/file_or_directory
– Pause/unpause current song:
c
– Toggle shuffle mode on/off:
s
– Quit cmus:
compose
compose filename
– With run-mailcap:
cryptsetup
Manage plain dm-crypt and LUKS (Linux Unified Key Setup) encrypted volumes.
– Initialize a LUKS volume (overwrites all data on the partition):
200
date
date +"%c"
date -u +"%Y-%m-%dT%H:%M:%SZ"
– Display the current date as a Unix timestamp (seconds since the Unix epoch):
date +%s
– Display a specific date (represented as a Unix timestamp) using the default format:
date -d @1473305798
dd
– Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso) and show the
progress:
– Clone a drive to another drive with 4MB block, ignore error and show progress:
201
dnf
Package management utility for RHEL, Fedora, and CentOS (replaces yum).
– Synchronize list of packages and versions available. This should be run first, before running
subsequent dnf commands:
dnf update
– Remove a package:
dnf upgrade
dpkg-query
dpkg-query -l
dpkg-query -l 'pattern'
dpkg-query -L package_name
dpkg-query -s package_name
202
dpkg
dpkg -i /path/to/file
– Remove a package:
dpkg -r package_name
dpkg -l pattern
dpkg -L package_name
dpkg -S file_name
du
Disk usage: estimate and summarize file and folder space usage.
– List the sizes of a folder and any subfolders, in the given unit (B/KB/MB):
du -b|k|m path/to/folder
– List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the
appropriate unit for each size):
du -h path/to/folder
du -sh path/to/folder
– List the human-readable sizes of a folder and of all the files and folders within it:
du -ah path/to/folder
– List the human-readable sizes of a folder and any subfolders, up to N levels deep:
du -h --max-depth=N path/to/folder
– List the human-readable size of all .jpg files in subfolders of the current folder, and show a
cumulative total at the end:
du -ch */*.jpg
203
edit
– Edit action can be used to view any file on default mailcap explorer:
edit filename
– With run-mailcap:
edquota
Edit quotas for a user or group. By default it operates on all file systems with
quotas. Quota information is stored permanently in the quota.user and quota
.group files in the root of the filesystem.
– Restrict operations to a given filesystem (by default edquota operates on all filesystems with
quotas):
sudo edquota -t
204
emerge
emerge --sync
emerge -avc
emerge -S keyword
equery
205
expand
expand file
expand
expand -i file
expand -t=list
expr
– Evaluate logical or math expression with an operator (‘+’, ‘-’, ’*‘,’&‘,’|’, etc.). Special symbols
should be escaped:
206
fc-list
fc-match
fc-pattern
figlet
figlet input_text
command | figlet
207
findmnt
findmnt
findmnt /dev/sdb1
findmnt /
findmnt -t ext4
findmnt LABEL=BigStorage
firewall-cmd
firewall-cmd --get-active-zones
firewall-cmd --list-all
– Permanently open the port for a service in the specified zone (like port 443 when in the
public zone):
– Permanently close the port for a service in the specified zone (like port 80 when in the public
zone):
firewall-cmd --reload
208
free
free
free -b/-k/-m/-g
free -h
free -s X
fuser
Display process IDs currently using files or sockets. Require admin privileges.
– Identify process using a TCP socket:
getent
getent group
getent services
209
groupadd
groupadd group_name
groupdel
groupdel group_name
groupmod
halt
halt
halt --reboot
210
head
hostname
hostname
hostname -i
hostname -I
hostname --fqdn
hostname new_hostname
211
htop
– Start htop:
htop
htop -u user_name
hwclock
Used for reading or changing the hardware clock. Usually requires root.
hwclock
– Write the current software clock time to the hardware clock (sometimes used during system
setup):
hwclock --systohc
hwclock --hctosys
ifdown
ifdown eth0
ifdown -a
212
ifup
ifup eth0
ifup -a
iostat
iostat
– Display a report of CPU and disk statistics with units converted to megabytes:
iostat -m
iostat -c
iostat -N
– Display extended disk statistics with disk names for device “sda”:
iostat 2
213
ip
ip a
ip r
iptables
Program that allows to configure tables, chains and rules provided by the Linux
kernel firewall.
214
jobs
BASH builtin for viewing information about processes spawned by the current
shell.
– View jobs spawned by the current shell:
jobs
jobs -l
– Display information about jobs with changed status:
jobs -n
jobs -p
– Display running processes:
jobs -r
– Display stopped processes:
jobs -s
journalctl
journalctl -b
– Show all messages from last boot:
journalctl -b -1
journalctl -f
– Show all messages by a specific unit:
journalctl -u unit
journalctl _PID=pid
– Show all messages by a specific executable:
journalctl /path/to/executable
215
locate
– Look for pattern in the database. Note: the database is recomputed periodically (usually
weekly or daily):
locate pattern
– Look for a file by its exact filename (a pattern containing no globbing characters is interpreted
as *pattern*):
locate */filename
– Recompute the database. You need to do it if you want to find recently added files:
sudo updatedb
logger
logger message
– Send the output to a remote syslog server running at a given port. Default port is 514:
– Use a specific tag for every line logged. Default is the name of logged in user:
– Log messages with a given priority. Default is user.notice. See man logger for all priority
options:
216
lsattr
lsattr
lsattr path
lsattr -R
– Show attributes of all the files in the current directory, including hidden ones:
lsattr -a
lsattr -d
lsb_release
lsb_release -a
lsb_release -d
– Print only the operating system name (ID), suppressing the field name:
lsb_release -i -s
– Print the release number and codename of the distribution, suppressing the field names:
lsb_release -rcs
217
lsblk
lsblk
lsblk -a
lsblk -b
lsblk -f
lsblk -i
lsblk -t
ltrace
ltrace ./program
ltrace -c /path/to/program
218
md5sum
md5sum filename1
– Read a file of MD5SUMs and verify all files have matching checksums:
md5sum -c filename.md5
mdadm
– Create array:
– Stop array:
mdadm -S /path/to/raid_device_file
– Remove disk:
mdadm -D /path/to/raid_device_file
219
mke2fs
mkfs.ext2 /dev/sdb1
mkfs.ext3 /dev/sdb1
mkfs.ext3 /dev/sdb1
mkfs.cramfs
mkfs.cramfs /dev/sdb1
mkfs.exfat
mkfs.exfat /dev/sdb1
220
mkfs.fat
mkfs.fat /dev/sdb1
mkfs.fat -f 5 /dev/sdb1
mkfs.minix
mkfs.minix /dev/sdb1
mkfs.ntfs
mkfs.ntfs /dev/sdb1
221
mkfs.vfat
mkfs.vfat /dev/sdb1
mkfs.vfat -f 5 /dev/sdb1
nethogs
sudo nethogs
222
netstat
netstat -a
netstat -l
netstat -t
netstat -p
netstat -c
netstat -rn
– List listening TCP and UDP ports (+ user and process if you’re root):
netstat -lepunt
nm
nm -g file.o
nm --demangle file.o
nm -u file.o
nm -a file.o
223
notify-send
– Show a notification with the title “Test” and the content “This is a test”:
pacman
pacman -Syu
pacman -S package_name
pacman -Q
pacman -Qe
pacman -Scc
224
pkgadd
pkgadd package_name
pkgadd -u package_name
pkginfo
pkginfo -i
pkginfo -l package_name
pkginfo -o pattern
pkginfo -f file
pkgmk
pkgmk -d
pkgmk -d -i
225
pkgmk -d -u
pkgmk -d -if
pkgmk -d -im
pkgmk -uf
pkgrm
pkgrm package_name
ports
ports -u
ports -l
– Check the differences between installed packages and the ports tree:
ports -d
print filename
– With run-mailcap:
226
prt-get
– Install a package:
– Remove a package:
prt-get sysup
pvcreate
pvcreate /dev/sda1
227
pwgen
pwgen -y length
pwgen -s length
pwgen -c length
quotacheck
Scan a filesystem for disk usage; create, check and repair quota files. It is best
to run quota check with quotas turned off to prevent damage or loss to quota
files.
– Force check even if quotas are enabled (this can cause damage or loss to quota files):
228
rdesktop
Remote Desktop Protocol client. It can be used to connect the remote computer
using the RDP protocol.
– Simple Examples:
– Use the customed resolution (use the letter ‘x’ between the number):
reboot
– Reboot immediately:
reboot
reboot -f
229
repquota
– Report quota stats for all users, even those who aren’t using any of their quota:
rpm
rpm -q httpd
230
run-mailcap
Run MailCap Programs. Run mailcap view, see, edit, compose, print - execute
programs via entries in the mailcap file (or any of its aliases) will use the given
action to process each mime-type/file.
– In simple language:
see
– See action can be used to view any file (usually image) on default mailcap explorer:
see filename
231
service
Manage services by running init scripts. The full script path should be omitted
(/etc/init.d/ is assumed).
service --status-all
setfacl
– Modify ACL of a file for user with read and write access:
setfacl -b file
232
sha1sum
sha1sum filename1
– Read a file of SHA1 sums and verify all files have matching checksums:
sha1sum -c filename.sha1
sha224sum
sha224sum filename1
– Read a file of SHA224 sums and verify all files have matching checksums:
sha224sum -c filename.sha224
sha256sum
sha256sum filename1
– Read a file of SHA256 sums and verify all files have matching checksums:
sha256sum -c filename.sha256
233
sha384sum
sha384sum filename1
– Read a file of SHA384 sums and verify all files have matching checksums:
sha384sum -c filename.sha384
sha512sum
sha512sum filename1
– Read a file of SHA512 sums and verify all files have matching checksums:
sha512sum -c filename.sha512
shuf
shuf filename
shuf -n n filename
shuf -i low-high
234
shutdown
shutdown -h now
– Reboot immediately:
shutdown -r now
– Reboot in 5 minutes:
shutdown -r +5 &
shutdown -h 13:00
shutdown -c
sort
sort filename
sort -r filename
sort -n filename
– Sort human-readable numbers (in this case the 5th field of ls -lh):
ls -lh | sort -h -k 5
235
ss
ss -a -t|-u|-w|-x
ss state/exclude bucket/big/connected/synchronized/...
– Show all TCP sockets connected to the local HTTPS port (443):
ss -t src :443
– Show all TCP sockets along with processes connected to a remote ssh port:
– Show all UDP sockets connected on specific source and destination ports:
– Show all TCP IPv4 sockets locally connected on the subnet 192.168.0.0/16:
strace
strace -p pid
– Count time, calls, and errors for each system call and report a summary on program exit:
strace -p pid -c
strace -p pid -T
strace program
236
sysctl
sysctl -a
sysctl -w section.tunable=value
sysctl fs.file-nr
sysctl fs.file-max
sysctl -p
systemctl
systemctl --failed
– Start/Stop/Restart/Reload a service:
systemctl daemon-reload
237
systemd-analyze
Show timing details about the boot process of units (services, mount points,
devices, sockets).
systemd-analyze blame
systemd-analyze critical-chain
tcpflow
timedatectl
timedatectl
timedatectl list-timezones
– To change timezones:
timedatectl set-ntp on
238
top
top
top -i
top -u user_name
– Show only the processes with the given PID(s), passed as a comma-separated list. (Normally
you wouldn’t know PIDs off hand. This example picks the PIDs from the process name):
tree
tree -L num
tree -d
tree -a
– Print the tree without indentation lines, showing the full path instead (use -N to not escape
whitespace and special characters):
tree -i -f
tree -s -h
tree -P *.txt
239
ufw
ufw enable
– Disable ufw:
ufw disable
– Show ufw rules, along with their numbers:
ufw deny 80
– Deny all UDP traffic to port 22:
ulimit
ulimit -a
– Get hard limit for the number of simultaneously opened files:
ulimit -H -n
– Get soft limit for the number of simultaneously opened files:
ulimit -S -n
– Set max per-user process limit:
ulimit -u 30
240
umask
Manage the read/write/execute permissions that are masked out (i.e. restricted)
for newly created files by the user.
umask
umask -S
– Change the mask symbolically to allow read permission for all users (the rest of the mask
bits are unchanged):
umask a+r
– Set the mask (using octal) to restrict no permissions for the file’s owner, and restrict all
permissions for everyone else:
umask 077
uname
Print details about the current machine and the operating system running
on it. Note: for additional information about the operating system, try the
lsb_release command.
uname -mp
uname -srv
uname -n
uname -a
241
unexpand
unexpand file
unexpand
unexpand -a file
useradd
useradd name
– Create new user belonging to additional groups (mind the lack of whitespace):
242
userdel
Remove a user.
– Remove a user and their home directory:
userdel -r name
usermod
vgcreate
wall
Write a message on the terminals of users currently logged in. Only available
to super-user.
– Send a message:
wall file
– Send a message with timeout (default 300):
243
watch
watch ls
watch -d df
whatis
whatis command
wpa_cli
wpa_cli scan
wpa_cli scan_results
– Add a network:
244
wpa_cli add_network number
– Enable network:
– Save config:
wpa_cli save_config
x11vnc
A VNC server that will enable VNC on an existing display. By default, once a
client disconnects the server will terminate.
x11vnc -shared
– Launch the server where the user can only view the screen, and will continue to run even
after the last client disconnects:
x11vnc -display :2
245
xclip
– Paste clipboard:
xdotool
xdotool click 3
xeyes
xeyes
246
xinput
List available input devices, query information about a device and change input
device settings.
xinput list
xinput float id
xrandr
Set the size, orientation and/or reflection of the outputs for a screen.
– Display the current state of the system (known screens, resolutions, …):
xrandr --query
– Disable disconnected outputs and enable connected ones with default settings:
xrandr --auto
– Set the resolution of HDMI2 to 1280x1024 and put it on the right of DP1:
247
xsel
xsel -ob
xsel -cb
– Output the X11 primary selection’s contents into the terminal (equivalent to a mouse middle-
click):
xsel -op
xsetwacom
Command line tool to change settings for Wacom pen tablets at runtime.
– List all the available wacom devices. The device name is in the first column:
xsetwacom list
– Set Wacom area to specific screen. Get name of the screen with xrandr:
– Rotate the input (useful for tablet-PC when rotating screen) by 0|90|180|270 degrees from
“natural” rotation:
– Set button to only work when the tip of the pen is touching the tablet:
248
yaourt
Arch Linux utility for building packages from the Arch User Repository.
– Synchronize and update all packages (including AUR):
yaourt -Syua
yaourt -S package-name
– List installed packages, versions, and repositories (AUR packages will be listed under the
repository name ‘local’):
yaourt -Q
yum
Package management utility for RHEL, Feodra, and CentOS (for older versions).
– Synchronize list of packages and versions available. This should be run first, before running
subsequent yum commands:
yum update
– Install a new package and assume yes to all questions (also works with update, great for
automated updates):
– Remove a package:
yum upgrade
249
zypper
zypper refresh
– Remove a package:
zypper update
250
3 OSX
airport
airport -I
airport sniff 1
airport -s
sudo airport -z
archey
archey
archey --nocolor
archey --macports
archey --offline
251
base64
– Encode a file:
base64 -i plain_file
– Decode a file:
base64 -D -i base64_file
brew
– Search formula:
– Install formula:
brew list
– Get latest version of installed formula (passing no formula updates all installed formulae):
– Update brew:
brew update
– Display information about formula, which contains formula version, installed path, depen-
dencies, etc.:
brew doctor
252
caffeinate
caffeinate -u -t 3600
– Prevent mac from sleeping until a command completes:
caffeinate -s command
carthage
carthage update
– Update dependencies and only build for iOS:
carthage bootstrap
– Rebuild a specific dependency:
date
date +"%c"
– Display the current date in UTC and ISO 8601 format:
date -u +"%Y-%m-%dT%H:%M:%SZ"
– Display the current date as a Unix timestamp (seconds since the Unix epoch):
date +%s
– Display a specific date (represented as a Unix timestamp) using the default format:
date -r 1473305798
253
dd
– Make a bootable usb drive from an isohybrid file (such like archlinux-xxx.iso):
dd if=file.iso of=/dev/usb_drive
– Clone a drive to another drive with 4MB block and ignore error:
defaults
254
diskutil
diskutil list
– Unmount a volume:
ditto
– Print a line to the Terminal window for every file that’s being copied:
– Copy a given file or folder, while retaining the original file permissions:
drutil
drutil eject
– Burn a folder as an ISO9660 filesystem onto a DVD. Don’t verify and eject when complete:
255
du
Disk usage: estimate and summarize file and folder space usage.
– List the sizes of a folder and any subfolders, in the given unit (KB/MB/GB):
du -k|m|g path/to/folder
– List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the
appropriate unit for each size):
du -h path/to/folder
du -sh path/to/folder
– List the human-readable sizes of a folder and of all the files and folders within it:
du -ah path/to/folder
– List the human-readable sizes of a folder and any subfolders, up to N levels deep:
du -h -d N path/to/folder
– List the human-readable size of all .jpg files in subfolders of the current folder, and show a
cumulative total at the end:
du -ch */*.jpg
head
256
hostname
hostname
hostname new_hostname
launchctl
– Activate an agent which requires root privileges to run and/or should be loaded whenever
any user logs in (note the absence of ~ in the path):
– Activate a system-wide daemon to be loaded whenever the system boots up (even if no user
logs in):
– Show all loaded agents/daemons, with the PID if the process they specify is currently running,
and the exit code returned the last time they ran:
launchctl list
– Unload a currently loaded agent, e.g. to make changes (note: the plist file is automatically
loaded into launchd after a reboot and/or logging in):
– Manually run a known (loaded) agent/daemon, even if it isn’t the right time (note: this
command uses the agent’s label, rather than the filename):
– Manually kill the process associated with a known agent/daemon, if it’s running:
257
locate
– Look for pattern in the database. Note: the database is recomputed periodically (usually
weekly or daily):
locate pattern
– Look for a file by its exact filename (a pattern containing no globbing characters is interpreted
as *pattern*):
locate */filename
– Recompute the database. You need to do it if you want to find recently added files:
sudo /usr/libexec/locate.updatedb
logger
logger message
– Send the output to a remote syslog server running at a given port. Default port is 514:
– Use a specific tag for every line logged. Default is the name of logged in user:
– Log messages with a given priority. Default is user.notice. See man logger for all priority
options:
258
look
md5
md5 filename
md5 -q filename
md5 -s string
mdfind
mdfind query
259
netstat
netstat -a
netstat -l
netstat -t
netstat -p {PROTOCOL}
netstat -c
networksetup
networksetup -listallnetworkservices
– Get currently connected Wi-Fi network name (Wi-Fi device usually en0 or en1):
260
nm
nm -g file.o
nm -u file.o
nm -a file.o
open
open file.ext
open /Applications/Application.app
open .
open -R path/to/file
– Open all the files of a given extension in the current directory with the associated application:
open *.ext
pbcopy
261
pbpaste
pmset
pmset -g
pmset -g batt
262
pod
– Create a Podfile for the current project with the default contents:
pod init
– Download and install all pods defined in the Podfile (that haven’t been installed before):
pod install
pod list
pod outdated
pod update
qlmanage
– Compute 300px wide PNG thumbnails of all JPEGs in the current directory and put them in
a directory:
– Reset Quicklook:
qlmanage -r
263
route
say
say -f filename.txt
say -v voice -r words_per_minute "I'm sorry Dave, I can't let you do that."
say -v ?
264
sed
– Replace the first occurrence of a string in a file, and print the result:
– Replace all occurrences of a string in a file, overwriting the file (i.e. in-place):
– Replace separator / by any other character not used in the find or replace patterns, e.g., #:
shutdown
shutdown -h now
– Sleep immediately:
shutdown -s now
– Reboot immediately:
shutdown -r now
– Reboot in 5 minutes:
shutdown -r +5
265
sw_vers
sw_vers -productVersion
sw_vers -buildVersion
sysctl
sysctl -a
sysctl -n hw.model
sysctl -n machdep.cpu.brand_string
– Show available CPU features (MMX, SSE, SSE2, SSE3, AES, etc):
sysctl -n machdep.cpu.feature
sysctl -w section.tunable=value
system_profiler
system_profiler SPHardwareDataType
266
systemsetup
systemsetup -setremotelogin on
– Make the machine never sleep and automatically restart on power failure or kernel panic:
systemsetup -liststartupdisks
top
top
– Start top sorting processes by internal memory size (default order - process ID):
top -o mem
267
tree
tree -L num
– Show directories only:
tree -d
– Show hidden files too:
tree -a
– Print the tree without indentation lines, showing the full path instead (use -N to not escape
whitespace and special characters):
tree -i -f
– Print the size of each node next to it, in human-readable format, with folders displaying their
cumulative size (as in the du command):
tree -s -h --du
– Find files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out direc-
tories that don’t contain matching files:
uname
Print details about the current machine and the operating system running on it.
Note: for additional information about the operating system, try the sw_vers
command.
– Print hardware-related information: machine and processor:
uname -mp
– Print software-related information: operating system, release number, and version:
uname -srv
– Print the nodename (hostname) of the system:
uname -n
– Print all available system information (hardware, software, nodename):
uname -a
268
w
Show who is logged on and what they are doing. Print user login, TTY, remote
host, login time, idle time, current process.
w -h
w -i
wacaw
A little command-line tool for Mac OS X that allows you to capture both still
pictures and video from an attached camera.
wacaw filename
– Record a video:
wacaw --to-clipboard
wacaw -L
269
xattr
xattr -l file
xattr -c file
xcodebuild
– Build workspace:
– Build project:
– Show SDKs:
xcodebuild -showsdks
270
xctool
xed
xed file1
xed -c filename1
xed -l 75 filename
xsltproc
271
4 SUNOS
devfsadm
devfsadm -c disk
– Cleanup any dangling /dev links and scan for new device:
devfsadm -C -v
devfsadm -C -v -n
prctl
Get or set the resource controls of running processes,. Tasks, and projects.
prctl PID
prctl -P PID
272
prstat
prstat
prstat -s rss
prstat -t
prstat -m
prstat -c -n 5 -s cpu 1
svcadm
– Disable service:
273
svccfg
svcs
svcs
svcs -vx
svcs apache
svcs -L apache
274