Level 1 — Beginner: everyday commands · wrap-up
Cheat sheet & self-check
23 questions across 6 lessons. Each answer links back to the lesson it came from.
Pick an answer to see if you got it, and why.
Q1. What is the shell?
Show answer
B. The terminal is the window; the shell (bash, zsh…) is the program inside it that interprets what you type and starts other programs.
From lesson 01 · Your first terminal sessionQ2. Your prompt ends with '#' instead of '$'. What does that usually mean?
Show answer
B. By convention, '#' marks a root shell. Root can change or delete anything, so double-check commands there.
From lesson 01 · Your first terminal sessionQ3. What's the fastest way to re-run a long command you typed ten minutes ago?
Show answer
B. Ctrl+R searches history backwards as you type. Press Enter to run the match, or keep pressing Ctrl+R for older matches.
From lesson 01 · Your first terminal sessionQ4. Which command shows the manual for 'grep'?
Show answer
B. man shows the manual page. Most commands also support --help for a shorter summary.
From lesson 01 · Your first terminal sessionQ5. Which path is absolute?
Show answer
C. Absolute paths start with / (the root) and mean the same thing from anywhere. The others are relative to your current directory.
From lesson 02 · Files & directoriesQ6. Where would you usually look for a service's configuration files?
Show answer
B. /etc holds system-wide configuration. Logs are under /var/log, programs under /usr/bin, temporary files in /tmp.
From lesson 02 · Files & directoriesQ7. What does 'rm -r' do that makes it dangerous?
Show answer
B. There's no undo on the command line. Check the path (ls it first) and prefer rm -i or moving to a scratch folder when unsure.
From lesson 02 · Files & directoriesQ8. Which command finds all '.log' files under /var larger than 50 MB?
Show answer
B. find walks the tree and combines tests like -name and -size. Quote the pattern so the shell doesn't expand it first.
From lesson 02 · Files & directoriesQ9. Which command keeps showing new lines as they're added to a log?
Show answer
B. tail -f follows the file. With logs that get rotated, tail -F also re-opens the file when it's replaced.
From lesson 03 · Reading & searching textQ10. What does the | (pipe) do?
Show answer
B. Pipes connect small tools: 'journalctl | grep -i fail | wc -l' counts failure lines.
From lesson 03 · Reading & searching textQ11. 'cmd > out.txt' still prints some messages to the screen. Why?
Show answer
B. Programs have two output streams: stdout (1) and stderr (2). '>' redirects only stdout.
From lesson 03 · Reading & searching textQ12. Which pipeline shows the 5 most common IP addresses at the start of each line of access.log?
Show answer
B. cut takes the first field, sort groups identical values, uniq -c counts them, sort -rn ranks by count, head keeps the top 5.
From lesson 03 · Reading & searching textQ13. What does permission 750 on a directory mean?
Show answer
B. 7 = rwx (4+2+1), 5 = r-x (4+1), 0 = ---. On a directory, x means 'may enter it', r means 'may list it'.
From lesson 04 · Users, groups & permissionsQ14. A script has permissions -rw-r--r--. Running ./deploy.sh gives 'Permission denied'. Fix?
Show answer
B. To run a file directly it needs the execute bit. Alternatively, pass it to an interpreter, which only needs read access.
From lesson 04 · Users, groups & permissionsQ15. What's wrong with 'usermod -G docker asha'?
Show answer
B. Always use -aG to append. Without -a, the user silently loses membership of every other supplementary group (including sudo).
From lesson 04 · Users, groups & permissionsQ16. Why is 'chmod 777' a bad fix for a permission problem?
Show answer
B. 777 grants write to everyone. Find out which user needs which access, and grant only that, usually via owner or group.
From lesson 04 · Users, groups & permissionsQ17. What's the difference between 'kill <pid>' and 'kill -9 <pid>'?
Show answer
B. Always try SIGTERM first so the program can finish writes and close connections. SIGKILL is the last resort.
From lesson 05 · Processes, services & packagesQ18. You installed nginx and it runs, but after a reboot it's gone. What was missed?
Show answer
B. start runs it now; enable makes it start at boot. 'systemctl enable --now' does both.
From lesson 05 · Processes, services & packagesQ19. Which column in 'top' shows the share of a CPU a process is using?
Show answer
B. %CPU is per CPU: on a 4-core machine a busy multi-threaded process can show up to 400%.
From lesson 05 · Processes, services & packagesQ20. On Ubuntu, what does 'apt update' do?
Show answer
B. update refreshes package lists; upgrade installs newer versions. Run update before install so you get current versions.
From lesson 05 · Processes, services & packagesQ21. nginx won't restart. What's the quickest way to find a config mistake?
Show answer
B. Most daemons have a config test (nginx -t, sshd -t, apachectl configtest). Use it before every restart.
From lesson 06 · Checkpoint: a day on a serverQ22. The page returns 403 Forbidden and index.html is -rw------- root root. Why?
Show answer
B. Web servers run their workers as an unprivileged user. The file needs to be readable by it, e.g. chmod 644.
From lesson 06 · Checkpoint: a day on a serverQ23. A developer needs to read /var/log/myapp (owned root:applog, mode 750). Best fix?
Show answer
B. Grant access through the group the directory already uses. Least privilege, and nothing else changes.
From lesson 06 · Checkpoint: a day on a server