Skip to content

Instantly share code, notes, and snippets.

@sajdoko
Created December 12, 2025 08:11
Show Gist options
  • Select an option

  • Save sajdoko/711d6fb46266e49c2082a72c693ce05e to your computer and use it in GitHub Desktop.

Select an option

Save sajdoko/711d6fb46266e49c2082a72c693ce05e to your computer and use it in GitHub Desktop.
Single copy-paste ready command that prints a clean, structured report. It works on CentOS / AlmaLinux / RHEL and still prints useful info on Ubuntu/Debian.
echo "===== SYSTEM ====="; \
uname -a; hostnamectl; cat /etc/os-release; \
echo; echo "===== CPU ====="; \
lscpu; \
echo; echo "===== MEMORY ====="; \
free -h; \
echo; echo "===== STORAGE ====="; \
lsblk; df -h; \
echo; echo "===== NETWORK ====="; \
ip a; ip r; \
echo; echo "===== LISTENING PORTS ====="; \
ss -tulpn; \
echo; echo "===== USERS ====="; \
cat /etc/passwd; \
echo; echo "===== GROUPS ====="; \
cat /etc/group; \
echo; echo "===== LAST LOGINS ====="; \
last -n 10; \
echo; echo "===== RUNNING SERVICES ====="; \
systemctl list-units --type=service --state=running; \
echo; echo "===== FIREWALL ====="; \
( firewall-cmd --state && firewall-cmd --list-all ) 2>/dev/null || ufw status 2>/dev/null || echo "No firewall tool detected"; \
echo; echo "===== LOGS (last 50 lines) ====="; \
tail -n 50 /var/log/messages 2>/dev/null || tail -n 50 /var/log/syslog 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment