Based on the Linux Master 1 exam syllabusReport an error
ps aux (usage, bare) / ps -ef (PPID, hyphen); controlling: signal order 15 → 9. Only 9 and 19 cannot be blocked, and negative nice is root-only.start (now) and enable (every boot) are separate.| Tool | Purpose | Key point |
|---|---|---|
ps aux | All + usage | No hyphen, %CPU/%MEM |
ps -ef | All + PPID | With hyphen, tracing parents |
top/htop | Real time | top is built in, htop must be installed |
pgrep/pstree | Search by name / tree | Avoids grep self-reference, visualizes hierarchy |
| Number | Name | Meaning | Can be blocked? |
|---|---|---|---|
| 1 | SIGHUP | Re-read config (reload) | Yes |
| 2 | SIGINT | Ctrl+C interrupt | Yes |
| 9 | SIGKILL | Forced termination (immediate) | No |
| 15 | SIGTERM | Graceful termination (kill default) | Yes |
| 19 | SIGSTOP | Stop | No |
nice is for launch time and renice for running processes.⚠️ Trap review: Don't mix
ps aux(bare) andps -ef(hyphen). Terminate in the order 15 (graceful) → 9 (forced). Only 9 (SIGKILL) and 19 (SIGSTOP) cannot be blocked. Negative nice is root only.killworks by PID,killall/pkillby name.
& (background), Ctrl+Z (stop), bg, fg, jobs, nohup.| Category | Zombie | Orphan |
|---|---|---|
| Child | Dead (Z, defunct) | Alive |
| Parent | Alive but doesn't wait | Terminated first |
| PPID | Original parent | Adopted by PID 1 |
| Danger | Occupies a PID (dangerous) | Harmless |
| Fix | Terminate/restart the parent | PID 1 reaps it automatically |
⚠️ Trap review: "Zombie = dead child + parent that doesn't collect it, orphan = living child + dead parent (adopted by PID 1)". A zombie can't be killed with
kill -9; you have to deal with the parent.Ctrl+Zis a stop (T), not termination. exec doesn't create a new process (PID kept).
| Runlevel | systemd target | Meaning |
|---|---|---|
| 0 | poweroff.target | Halt |
| 1 | rescue.target | Single-user (rescue) |
| 2·3·4 | multi-user.target | Text multi-user |
| 5 | graphical.target | GUI |
| 6 | reboot.target | Reboot |
systemctl is important.| Command | Meaning |
|---|---|
start/stop | Turn on/off immediately |
enable/disable | Register/unregister auto-start at boot |
enable --now | Register + start immediately |
status | Check active (running) and enabled (auto) at once |
0 and 6 are forbidden as the default runlevel. 2, 3, and 4 are all multi-user.target. start (once, now) and enable (auto at boot) are separate. daemon-reload is required after editing a unit file. [Install] WantedBy= is the target that enable links to. Logs: journalctl -u service -f.
* , - /, and specifying both day and weekday is OR.| Tool | Count | When | Daemon |
|---|---|---|---|
| cron | Recurring | Fixed interval | crond |
| at | Once | Specified time | atd |
| batch | Once | When load is low | atd |
| Item | User crontab | System crontab |
|---|---|---|
| Fields | 5 fields + command | 5 fields + user + command (6) |
| Management | crontab -e/-l/-r | /etc/crontab, /etc/cron.d/ |
The order is "min-hour-day-month-weekday". Weekday 0 and 7 = Sunday. A user crontab has 5 fields, /etc/crontab has 6. cron = recurring, at/batch = once. allow > deny in priority. crontab -r deletes everything, so be careful. The at list is atq, deletion is atrm.
Scenario A — Safely terminating a runaway process
ps aux --sort=-%cpu | head # identify the process hogging the CPU
pgrep -l runaway # get the exact PID
kill -15 1234 # try graceful termination first
kill -9 1234 # force termination if that doesn't workScenario B — Registering a new service + auto-start + checking logs
vi /etc/systemd/system/myapp.service # write the unit file
systemctl daemon-reload # make systemd notice the change (required)
systemctl enable --now myapp # register + start immediately
systemctl status myapp # check active/enabled
journalctl -u myapp -f # follow logs in real timeScenario C — Automating a daily backup at dawn
crontab -e
# 0 3 * * * /usr/local/bin/backup.sh # every day at 3 a.m.
crontab -l # confirm registrationnice or run it with batch when the system is idle — integrates Days 1, 2, and 4.The standard flow of real-world incident response is exactly this order — find the culprit with ps/top (Day 1), stop it safely with signals 15 → 9 (Day 1), restart the service cleanly with systemctl (Day 3), check the cause in the logs with journalctl (Day 3), and set up an inspection job in cron to prevent recurrence (Day 4). This week's content is the backbone of real-world operations, not just of the exam.
enable --now does both.Click a choice to reveal the answer and explanation.
Question 1
Which command is most appropriate for checking all processes together with the parent process (PPID) column?
Question 2
Which pair of signals below cannot be caught or ignored by a process and therefore always takes effect?
Question 3
When you give the kill command only a PID with no option, which signal is sent by default, and what is its nature?
Question 4
Which of the following is correct about the nice value?
Question 5
Which of the following correctly describes the difference between a zombie process and an orphan process?
Question 6
What is the result of pressing Ctrl+Z during a foreground job?
Question 7
In a systemd environment, which target corresponds to the old runlevel 3 (text multi-user)?
Question 8
What is the result of running only systemctl enable sshd without start?
Question 9
Which command must you run right after creating or editing a systemd unit file?
Question 10
When does the crontab entry 0 9 * * 1-5 /work.sh run?
Question 11
Which of the following is correct about the format difference between a user crontab and a system crontab (/etc/crontab)?
Question 12
Which of the following is correct about cron, at, and batch?