NUnix · L3 MIAGE · CM2 · 90 minutes
ISTIC · University of Rennes
2026–2027
A computer is slow. Would adding RAM help?
Check which resource is under pressure first.
Check CPU, memory and disk usage
| Resource | Question | First observation |
|---|---|---|
| CPU | Is computation keeping a processor busy? | top, ps |
| RAM | Is memory pressure affecting the system? | free -h |
| Disk | Can the filesystem store more data? | df -h . |
Adding RAM does not create free space on a full disk.
| Tool | Scope | Question |
|---|---|---|
df |
A filesystem | How much space is available? |
du |
A directory tree | Which directories use space? |
find |
Individual entries | Which files fit my criteria? |
Start broad, then inspect a specific file.
.c files below the current directory.'*.c'?find . -type f -name '*.c'find without expanding it first.Read log records and search for errors
Save these four lines as app.log:
10:00 INFO STARTED
10:01 ERROR DISK_FULL
10:02 ERROR TIMEOUT
10:03 ERROR DISK_FULL
| Field | Meaning |
|---|---|
| 1 | Time |
| 2 | Severity |
| 3 | Event code |
The editor ed had the command pattern:
g/re/p
grep makes that text search available as a separate command.
| Channel | Number | Usual terminal behaviour |
|---|---|---|
stdin |
0 | Read keyboard input |
stdout |
1 | Display normal output |
stderr |
2 | Display diagnostic messages |
The exit status is a number reported when a command finishes. It is separate from the text it prints.
Choose where a command reads and writes
sort names.txt > names.txt
The shell opens and truncates names.txt before starting sort. The input is already gone.
Write to a different file, then inspect the result.
a | b connect?a > out.txt also redirect standard error?>>a's stdout to b's stdin.2> to redirect stderr.grep.More search expressions and interactive process control
| Action | Effect |
|---|---|
| Ctrl+Z | Suspend the foreground job |
bg %1 |
Resume job 1 in the background |
fg %1 |
Resume job 1 in the foreground |
A job number belongs to a shell.
A PID identifies a process in the system.
| Action | Meaning |
|---|---|
kill PID |
Send SIGTERM to a process |
| Ctrl+C | Send SIGINT to the foreground process group |
Ctrl+\ |
Send SIGQUIT to the foreground process group |
| Ctrl+Z | Send SIGTSTP to suspend the foreground group |
| Ctrl+D | Terminal end-of-input action |