THINK FIRST·CODE LATER

← All labs

Linux in practice: meet your operating system

Problem

Use a Linux machine (a lab PC, a virtual machine, WSL on Windows, or a free cloud shell). Run the commands below, copy the key lines of output into your answer, and explain what each tells you about the OS as a resource manager.

  1. uname -a — kernel name, version, architecture.
  2. lscpu (or cat /proc/cpuinfo | grep "model name" | head -1 and nproc) — how many cores?
  3. free -h — total, used, free and available memory; what is the difference between free and available?
  4. uptime — how long running; what are the three load average numbers?
  5. ps aux --sort=-%cpu | head -6 — the five processes using the most CPU.
  6. ps -eo stat | cut -c1 | sort | uniq -c — how many processes in each state (R, S, D, Z…)?
  7. ls /proc | head, then cat /proc/1/status | head -8 — what is /proc and what is process 1?

Finish with three sentences: What surprised you? Which resource looks most loaded on your machine? Which chapter of this course will explain it?

Work it out on paper, in a document or here, then compare with the model answer. Your answer stays in your browser — it is never sent to or stored on the server.