This page is a reference for useful command-line tools and one-liners for server management, grouped by category.
lsof -i tcp:8080
Finds the process ID (PID) that is holding onto a specific network port.
netstat -plunt
Shows which programs are actively listening on TCP and UDP ports.
iptables -A INPUT -s 1.2.3.4/32 -j DROP
Bans a given IP address from accessing your server using the firewall.
fuser -k filename
Kills a process that is currently locking a file.
python -m SimpleHTTPServer
Starts a simple web server in the current directory on port 8000.