Show Menu
Cheatography

Raspbian Cheat Sheet (DRAFT) by

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

Main

watch -n [sec] [state­ment]
Prints the output of statement every sec seconds
nano [file]
Edits file
touch [file]
Creates empty file
lsmod
Lists all loaded modules
modinfo [module]
Load infos of module
dmesg
Kernel-Log
free
Lists RAM usage
htop
Starts process manager
uptime
Runtime, system load
uname -a
print OS version
top
Actual system load (like htop)
lscpu
Lists CPU inform­ation
lsblk
Lists all block devices
lsusb
Lists all USB devices

File System Operations

df -h
Show disk space
df -i
Show free inodes

Package Managing (sudo apt-get ...)

update
Sync soruces
upgrade
Execute updates
dist-u­pgrade
Execute updates with enhanced package conflict management
install [package]
Installs package
install --rein­stall [package]
Reinstalls package
remove [package]
Uninstalls package (excl. configs)
purge [package]
Uninstalls package (incl. configs)
check
Checks consis­tency
clean
Removes local packag­e-s­ources
autoremove
Removes unused packages
Execute all with sudo apt-get ...
 

Network operations

scp [file] [user]­@[h­ost­]:[­des­tin­ation]
Copying files or folders via SSH (-r for recursive)
ip addr
Lists all local IP adrresses

File operations

find [path] -name [file]
Search for filename in path
less [file]
Shows content of file
tail -n [N] [file]
Outputs the last N lines of file

Config­uration (/boot­/co­nfi­g.ini)

ld_rot­ate=2
Rotate Rpi LCD Display
dtdebug=on
Write debug log (sudo vcdbg log msg)

Security

Change default password with passwd.
Change SSH default port in /etc/s­sh/­ssh­d_c­onfig.
sudo apt-get install fail2ban
Configure fail2ban (/etc/f­ail­2ba­n/j­ail.conf):
ignoreip = 127.0.0.1 # local IP
bantime = 3600 # ban time in s
maxretry = 5 # ban after 5 retries