Skip to content

Instantly share code, notes, and snippets.

View drichline's full-sized avatar

Dakota Richline drichline

View GitHub Profile
@drichline
drichline / motd.sh
Created November 30, 2024 21:02
motd.sh
#!/bin/bash
# System info
echo -e " System info on......: $(date '+%H:%M %Y-%m-%d')"
echo -e " Hostname............: $(cat /etc/hostname)"
echo -e " Last login..........: $(last -w | head -n1 | tr -s ' ' | cut -f1 -d' ') from $(last -w | head -n1 | tr -s ' ' | cut -f3 -d' ')"
echo -e " Uptime..............: $(uptime -p | sed 's/^up.//')"
echo -e " Load Averages.......: $(cat /proc/loadavg | cut -f1 -d' '), $(cat /proc/loadavg | cut -f2 -d' '), $(cat /proc/loadavg | cut -f3 -d' ')"
echo -e " Memory..............: Used: $(free -m | grep Mem: | xargs | cut -f3 -d' ')M | Free: $(free -m | grep Mem: | xargs | cut -f7 -d' ')M | Total: $(free -m | grep Mem: | xargs | cut -f2 -d' ')M"
echo -e " CPU Temperature.....: $(sensors | grep Package | cut -f2 -d'+' | cut -f1 -d' ')"
echo -e " Root disk...........: Used: $(df -h / | tail -n1 | tr -s ' ' | cut -f3 -d' ') | Free: $(df -h / | tail -n1 | tr -s ' ' | cut -f4 -d' ') | Total: $(df -h / | tail -n1 | tr -s ' ' | cut -f2 -d' ')"