Terminal Cheatsheet
Terminal Cheatsheet
101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010100101010010101010101
CHEAT SHEET
LINUX TERMINAL
000101011111110011111110101010101001010100101001010111010101101010101001110010110111010101010101010100100101001010100101
010010101110101011010101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010
101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010100101010010101010101
000101011111110011111110101010101001010100101001010111010101101010101001110010110111010101010101010100100101001010100101
Created by @Manz ( http://twitter.com/Manz ) https://terminaldelinux.com/
h Help Manual & information f Files MKDIR PERMISSIONS p Packages Install & uninstall
* --help fast & short help FOLDERS (DIRECTORIES) -p all dirs OWNER GROUP OTHERS INSTALL/UNINSTALL PACKAGES
HELP COMMANDS mkdir create dir drwxr-xr-x -rw-r--r-- apt-get package manager
LS
DIRECTORY REGULAR FILE
man manual page (wide) pwd current dir -l long data apt friendly apt-get
whatis short description ls list files & dirs -h human r READ SYM. LINK l
aptitude friendly apt-get
apropos related help w WRITE NAMED PIPE p
exa enhanced ls -R recursive x EXEC/OPEN SOCKET
CHAR DEV
s
c wajig friendly apt-get
cd change to dir - NO PERMISSION BLOCK DEV b
SEARCH/LIST PACKAGES
u Users Info about users pushd / popd directory stack
CHANGE AND INFO
APT-GET apt-cache search packages
autojump smart jump to dirs update clean remove apt-file list package contents
whoami current user tree list files in tree format
su switch to user [root] install purge download MANUAL MANAGE PACKAGES
nethogs net monitor by process cclive media downloader umask set permission mask exit / logout end shell
wondershaper bandwidth limit reboot reboot the machine
r Remote SCP/SSH SYNTAX CHMOD poweroff / shutdown switch off
iptraf-ng network monitor halt stop all CPU functions
tcpdump network activity dump CONNECTION scp user@ip:/folder remote 0 none=- 3 wx
1 exec=x 5 rx init send control init level
netstat print network statistics telnet telnet connection SSH MULTIPLEXORS
2 write=w 6 rw
MAC ADDRESS ftp file transfer connect -C compress 4 read=r 7 rwx screen multiplexor & manager
arp show mac/ip address cache ssh remote connection -X X11 redir COMMON tcvt 2-cols virtual terminal
arping ping mac address sftp connect ftp via ssh -c cipher 777 755 644 655 tmate multiplex & term sharing
FIREWALL sshfs connect disk via ssh TMUX tmux terminal multiplexer
iptables ip packet filter & NAT COPY
^B+" split horiz ^B+→ move to byobu screen/tmux wrapper
shorewall firewall for iptables scp remote cp via ssh ^B+% split vert ^B+ +→ resize
ALT
CTRL R
ufw firewall for iptables rsync remote sync files ^D close term ^B+^O rotate REV. HISTORY
010010101110101011010101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010
101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010100101010010101010101
CHEAT SHEET
LINUX TERMINAL
000101011111110011111110101010101001010100101001010111010101101010101001110010110111010101010101010100100101001010100101
010010101110101011010101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010
101010011100101101110101010101010101001001010010101001010101001010000010101111111001111111010101010100101010010101010101
000101011111110011111110101010101001010100101001010111010101101010101001110010110111010101010101010100100101001010100101
Created by @Manz ( http://twitter.com/Manz ) https://terminaldelinux.com/
t Text manipulation d Disks & Partitions p Processes & threads s Services & Daemons
MAIN CONTENT PARTITIONS / BLOCK DEVICES PROCESSES VIEWERS SERVICES
echo print line of text parted manipulate partitions ps show active processes /etc/init.d/* sysvinit
cat print or concatenate files fdisk manipulate partition table pstree tree-format version of ps service service wrapper
tac reverse cat cfdisk enhanced fdisk atop system/process monitor systemctl systemd
PAGINATE TOOLS mkfs make/create a filesystem top show top processes & info journalctl systemd logs
more classic pager dd low level data duplicator htop enhanced top WEB SERVER
less enhanced pager RECOVERY/REPAIR BACKGROUND & FOREGROUND apachectl apache control
most enhanced less pager fsck check & repair filesystem jobs list jobs (bg or stopped) nginx http reverse proxy
COMPRESS FILTERING CAT/LESS TOOLS testdisk scan & repair partitions bg move process to background htpasswd gen auth pass
zcat .gz bzcat .bz2 xzcat .xz photorec recover lost files/data fg move process to foreground LOGS
MOUNT
zless .gz bzless .bz2 xzless .xz PRIORITY PROCESS ccze robust log colorizer
mount enable a filesystem lnav ncurses log viewer
GENERAL FILTERING TOOLS
umount disable a filesystem nice run with custom priority
head print first part renice change priority goaccess fast log viewer
DISKSPACE
tail print last part df show disk free
KILL PROCESSES SYSTEMCTL
rev reverse line characterwise du show disk used kill send signal to process status service status
nl number lines ncdu enhanced disk used killall kill all processes by name start init service
sort reorder lines stop halt service
fdupes find duplicate files h Hardware & System restart stop & start
wc count bytes/chars/words/lines
g Games & Fun
SYSTEM SOFTWARE INFO reload reload config
uniq count or omit repeated lines
FUN
uname show distro/kernel info
TRANSFORM TOOLS APACHE
lsb_release show distro info
iconv convert to diff encoding fortune print rnd fortune cookie uptime data uptime, users & load a2enconf enable config
tr translate or delete chars sl aim to correct sl instead ls HARDWARE
a2disconf disable config
expand convert tabs to spaces cowsay configurable thinking cow a2ensite enable site
toilet / figlet display large chars nmon sysadmin monitor tool a2dissite disable site
unexpand convert spaces to tabs cmatrix simulate matrix screen gtop system monitor dashboard a2enmod disable mod
FRAGMENT FILTERING TOOLS GAMES
iotop input/output monitor a2dismod disable mod
cut remove sections or fragments iostat report cpu & i/o stats
ninvaders ncurses space invaders
paste merge lines mpstat report multiprocess stats NGINX
bastet bastard tetris clone
glances system monitoring tool ngx-conf enable site
moon-buggy drive across moon
POWERFUL FILTERING/TRANSFORM TOOLS hwinfo hardware information ngx-conf disable site
nsnake ncurses snake game
grep print lines matching pattern inxi hardware information ngx-conf remove site
pacman4console pacman clone
gawk pattern scanner & process greed erase number grid game MEMORY ngx-conf list list all conf
sed stream editor for filtering nethack-console explore mazes free show free & used memory
DOCKER
xargs build & execute commands freesweep minesweeper clone vmstat virtual memory stats
nettoe network tic tac toe clone pmap show memory map process search find image on hub
t Time asciijump ascii ski jump game DEVICES run exec cmd container
bombardier gnu bombing game lspci list PCI devices images / ps list img/cont
date print or set date/time start / stop container
lsusb list USB devices
CALENDARS
m Image Handling lscpu list CPU features rmi / rm remove img/cont
cal display a calendar pull get image from reg
ncal display a alternative cal
LOSSY (JPEG RELATED) lsblk list block devices
jpeginfo show jpeg information lsof list open files push put image to reg
pal display a event calendar
jpegoptim optimize jpeg images lslocks list local system locks FFMPEG
TIMERS
jpegtran jig jpeg transform KERNEL & MODULES
-i input file/information
timeout run cmd w/time limit mozjpeg mozilla jpeg optimizator
time benchmark command dmesg diagnostic messages -vcodec video codec
jhead exif header manipulator lsmod list kernel modules status -acodec audio codec
sleep delay specified time webp webpicture google format
watch exec program repeatedly depmod gen dep/map mod files -b:a bitrate audio 192k
LOSSLESS (PNG RELATED) modinfo show info about a mod -b:v bitrate video
SCHEDULE COMMANDS
pngmeta extract png metadata modprobe add/remove modules -vn remove video
at queue jobs for later exec optipng optimize png images insmod insert mod into kernel -an remove audio
cron exec scheduled cmds pngquant png compressor rmmod remove mod from kernel -vol change volume 256
CRONTAB pngcrush optimize png files -ss start at N:N time
MINUTE (0-59) DAY (1-31) WEEKDAY (0-6) pngnq quantize png images m Audio / Video -to ends at N:N time
HOUR (0-23) MONTH (1-12)
ANIMATED (GIF RELATED) MEDIA PLAYER -t vid duration N secs
gifsicle manipulation gif tool mplayer cli media player -vf hflip horizontal flip
*/5 4 1 * * command sample line -vf vflip vertical flip
apngopt apng otimizator mpv media player enhanced
c Checksum vlc videolan media player -vf scale=W:H resize vid
IMAGEMAGICK
CHECKSUM BASE mpsyt youtube media player -vf crop=W:H:X:Y crop
convert transform/convert image -vf vignette=PI/4 effects
sum checksum & count blocks identify describe format image
MUSIC
cksum checksum & count bytes music123 play sound files -vf fade=t=in:st=0:d=5,
composite overlaps images fade=t=out:st=25:d=5
COMPUTE & CHECK MESSAGE DIGGEST
mogrify convert (overwrite src) id3tool mp3 editor id3 tags
arecord ALSA sound recorder -vf setpts=0.02*PTS
b2sum BLAKE2 sha224sum SHA224 montage combine mult. images -pix_fmt yuv420p / rgb24
md5sum MD5 sha256sum SHA256 stream stream 1+ components aplay ALSA sound player
shasum SHA sha384sum SHA384 import save visible region to file MEDIA CONVERTER
sha1sum SHA1 sha512sum SHA512 compare math/visual diff image ffmpeg media converter