Commands for monitoring system
🗎 Refs: Check port in use on Linux
# Ubuntu sudo lsof -i -P -n | grep LISTEN sudo lsof -i:$PORT sudo ss -tulpn | grep LISTEN sudo nmap -sTU -O $IP_ADDRESS # AlmaLinux sudo firewall-cmd --list-ports
ip -4 addr show | grep inet
systemctl
# Specified service sudo systemctl status $SERVICE_NAME # All running services: sudo systemctl --type=service
echo "Free disk space:" && \ df -h ~ | awk 'NR==2 {print $4 " available on " $6}' && \ echo -e "\nTop 5 largest directories in $HOME:" && \ du -h --max-depth=1 ~ | sort -hr | head -n 5