How to Check Linux Uptime and System Info
Get a quick picture of your Linux system — uptime, kernel version, hostname, CPU, and OS details — using uptime, uname, and hostnamectl.
Why Check System Info?
Knowing your kernel version, uptime, and hardware at a glance helps when troubleshooting, filing bug reports, or documenting a server. These commands give you the facts in seconds.
uptime — How Long Has It Been Running?
uptime
Output: 14:32:05 up 42 days, 3:18, 2 users, load average: 0.15, 0.10, 0.09
- Current time
- How long the system has been up
- Number of logged-in users
- CPU load averages for the past 1, 5, and 15 minutes
A load average above 1.0 per CPU core suggests the system is under heavy load.
uname — Kernel and OS Information
uname -a # all info: kernel name, version, architecture
uname -r # just the kernel version
uname -m # machine architecture (x86_64, arm64, etc.)
Example output: Linux myserver 6.8.0-45-generic #45-Ubuntu SMP x86_64 GNU/Linux
hostnamectl — Detailed System Identity
hostnamectl shows a clean summary of the machine's identity including OS, kernel, and hardware:
hostnamectl
Static hostname: webserver-01
Icon name: computer-server
Chassis: server
Machine ID: a1b2c3d4e5f6...
Boot ID: ...
Operating System: Ubuntu 24.04 LTS
Kernel: Linux 6.8.0-45-generic
Architecture: x86-64
Change the hostname
sudo hostnamectl set-hostname new-hostname
lsb_release — OS Version Details
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble
Or just read the file: cat /etc/os-release
w — Who Is Logged In and What Are They Doing?
w
Shows current users, their terminal, login time, and what command they're running.
last — Recent Login History
last # login history
last reboot # reboot history (great for checking unexpected restarts)
Quick Reference
uptime— uptime + load averagesuname -a— full kernel infohostnamectl— OS and hardware summarylsb_release -a— Linux distro versionlast reboot— when did the server last restart?