System Overview

"What kind of server is this? How long has it been up? What version is the kernel?"

These questions come up constantly. Let's learn the quick answers.

hostname - What's This Machine Called?

Terminal
$hostname
webserver-01
$hostname -f
webserver-01.example.com

-f gives the fully qualified domain name (FQDN).

uname - System Information

Terminal
$uname
Linux
$uname -a
Linux webserver-01 5.15.0-91-generic #101-Ubuntu SMP x86_64 GNU/Linux

-a shows everything: kernel name, hostname, kernel version, architecture.

Individual Flags

FlagShows
-sKernel name (Linux)
-nHostname
-rKernel release
-vKernel version
-mMachine hardware (x86_64)
-oOperating system
Terminal
$uname -r
5.15.0-91-generic
$uname -m
x86_64

uptime - How Long Running?

Terminal
$uptime
10:30:45 up 45 days, 3:22, 2 users, load average: 0.15, 0.10, 0.09

Shows:

  • Current time
  • Uptime
  • Users logged in
  • Load averages (1, 5, 15 minutes)

Load Average

Load average shows CPU demand. Compare to your core count:

  • 1.0 on 1 core = 100% utilized
  • 4.0 on 4 cores = 100% utilized Higher than core count = overloaded

Distribution Information

/etc/os-release

Terminal
$cat /etc/os-release
NAME="Ubuntu" VERSION="22.04.3 LTS (Jammy Jellyfish)" ID=ubuntu VERSION_ID="22.04" PRETTY_NAME="Ubuntu 22.04.3 LTS"

lsb_release

Terminal
$lsb_release -a
Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy

Date and Time

Terminal
$date
Tue Jan 14 10:30:45 UTC 2025
$date +%Y-%m-%d
2025-01-14
$date +%s
1736850645

%s gives Unix timestamp (seconds since 1970).

Timezone

Terminal
$timedatectl
Local time: Tue 2025-01-14 10:30:45 UTC Universal time: Tue 2025-01-14 10:30:45 UTC Time zone: UTC (UTC, +0000)

Quick System Check Script

echo "=== System Overview ==="
echo "Hostname: $(hostname)"
echo "OS: $(cat /etc/os-release | grep PRETTY_NAME | cut -d'=' -f2)"
echo "Kernel: $(uname -r)"
echo "Uptime: $(uptime -p)"
echo "Users: $(who | wc -l)"
echo "Load: $(cat /proc/loadavg | cut -d' ' -f1-3)"
Knowledge Check

What does a load average of 4.0 on a 2-core system indicate?

Quick Reference

CommandShows
hostnameMachine name
uname -aAll system info
uname -rKernel version
uptimeUptime and load
cat /etc/os-releaseDistribution info
dateCurrent date/time
timedatectlTime settings

Key Takeaways

  • hostname tells you what machine you're on
  • uname -a gives kernel and architecture
  • uptime shows how long system's been running
  • /etc/os-release identifies the distribution
  • Load average should stay below your core count

Next: checking disk usage.