Skip to content

Instantly share code, notes, and snippets.

@dsager
Created February 20, 2025 23:02
Show Gist options
  • Save dsager/99e3086e77ae362c070ff487e79b0c15 to your computer and use it in GitHub Desktop.
Save dsager/99e3086e77ae362c070ff487e79b0c15 to your computer and use it in GitHub Desktop.
Collects and prints system information and relevant logs on Manjaro Linux.
#!/usr/bin/env bash
# manjaro_system_info.sh
# Collects and prints system information and relevant logs on Manjaro Linux.
# Usage (optional redirection): ./system_info.sh > /tmp/system_info.log 2>&1
echo "=== 1) BASIC SYSTEM INFORMATION ==="
echo "Kernel version:"
uname -r
echo
echo "Manjaro version:"
# If lsb_release isn't installed, fallback to /etc/os-release
if command -v lsb_release &>/dev/null; then
lsb_release -a
else
cat /etc/os-release
fi
echo
echo "CPU Model:"
lscpu | grep "Model name"
echo
echo "GPU Information:"
lspci | grep -i vga
echo
echo "RAM Usage:"
free -h
echo
echo "Disk Space:"
df -h
echo
echo "=== 2) HARDWARE DETAILS ==="
echo "PCI Devices:"
lspci
echo
echo "USB Devices:"
lsusb
echo
echo "Storage Devices:"
lsblk
echo
echo "=== 3) RELEVANT SYSTEM LOGS ==="
echo "Last 50 Boot Messages (requires sudo):"
sudo journalctl -b -n 50
echo
echo "Display-related Logs (DRM) (requires sudo):"
sudo journalctl -k | grep -i drm
echo
echo "Kernel Errors (dmesg) (requires sudo):"
sudo dmesg | grep -i error
echo
echo "GRUB Bootloader Entries:"
cat /boot/grub/grub.cfg | grep menuentry
echo
echo "System information collection complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment