AI Hints
Home›Linux Tutorial›Watching the System
Linux · Lesson 98 of 120

System Information

Memory, disk, and uptime.

⏱ 2 min read▶ Video at 2:11:22🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

Is the server running out of memory? Is the disk full? How long has it been running? A handful of quick commands answer all of these, in seconds.

System Information
From the video: System Information
  • Out of memory?
  • Disk full?
  • How long running?

Which Linux is this?

The file slash ETC/OS release describes the system. Head shows the first few lines, with the name and version. Ubuntu twenty four point zero four. N proc prints how many processor cores there are.

Terminal
head -n 4 /etc/os-release
PRETTY_NAME="Ubuntu 24.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.5 LTS (Noble Numbat)"
nproc
8

Memory and disk

Free dash H shows memory, in human sizes. The available column is the one to watch. That's how much programs can still use. DF dash H on slash shows the main disk, and how full it is, as a percentage.

Terminal
free -h
               total        used        free      shared  buff/cache   available
Mem:            10Gi       2.1Gi       3.9Gi        38Mi       4.9Gi       8.6Gi
Swap:          1.0Gi          0B       1.0Gi
df -h /
Filesystem      Size  Used Avail Use% Mounted on
overlay         103G   40G   58G  41% /

More quick checks

Uptime shows how long the computer has been running, and the load average, how busy it's been. U name dash R shows the kernel version. And LSBLK lists the disks and their partitions. Together, these give you a full health check in a few seconds.

keyvalue
uptimerunning time and load
uname -rkernel version
free -hmemory
df -hdisk space

Summary

OS release names the system, N proc counts cores, free shows memory, and DF shows disk space. Next, reading the system's logs.

Key takeaways
  • cat /etc/os-release
  • free -h
  • df -h /
Next up: System Logs — what happened, and when