Session 22 · Week 6 · Handout E
Command anatomy — dissection worksheet
Name

Date
For each command: identify the command name, list every option and what it does (use man to look them up), name the arguments, then write a plain-English description of what the whole command does. The grammar reference below applies to every command in Linux.
Command
Always first. The program name. ls, grep, find, cp
Options / flags
Start with - or --. Short: -l. Long: --long. Short can combine: -la
Arguments
What the command acts on. Files, paths, text. Do not start with - (usually).
Commands to dissect
1. grep -in "error" /var/log/syslog
Command name
Arguments
Options — look each one up in man grep
FlagWhat it does
Plain-English: what does this whole command do?
2. cp -rv ~/documents /tmp/backup
Command name
Arguments
Options — look each one up in man cp
FlagWhat it does
Plain-English: what does this whole command do?
3. ls -lhSt /usr/bin
Command name
Arguments
Options — there are 4 combined here, separate and look up each one
FlagWhat it does
Plain-English: what does this whole command do? What order are results in?
4. find /etc -name "*.conf" -type f -size +1k
Command name
Starting path (argument)
Search criteria — what does each one filter?
CriterionWhat it filters / means
-name "*.conf"
-type f
-size +1k
Plain-English: what does this whole command find?
Write a command of your own using at least 2 flags and 1 argument. Swap with a partner and let them dissect it without your help.
Partner's dissection (they fill this in):
Session 24 · Week 6 · Handout F
Terminal challenge — navigation and reading
Name

Date
Rules
No Dolphin. No file manager. Terminal only. Work individually. Write the exact command you used for every task — the answer is not enough, the command is what matters. You may use man, --help, and apropos at any time.
1.Find the largest file in /usr/share. What is its name and size?
Command used
Answer
2.How many lines does /etc/passwd have?
Command used
Answer
3.Navigate to /var/log and list only files modified in the last 7 days. How many are there?
Command used
Answer
4.Find any file in /etc whose name contains the word "host". List all matches.
Command used
Files found
5.Show the last 5 lines of /var/log/syslog.
Command used
First line shown
6.What shell are you running? Show the command that tells you — not just the answer.
Command used
Shell path
7.How long has this system been running? Find the right command using the help system — do not guess.
How you found it
Command used
Uptime
8.Navigate to /usr/share/doc using tab completion only — never type the full path at once.
What you typed
pwd confirms
completed without typing full path
9.Rerun the command from task 1 using Ctrl+R history search — do not retype it.
Search string used
reran using Ctrl+R — did not retype
10.Open /etc/hostname in less. Search for the hostname text inside less. Quit. Write the search shortcut you used.
Command to open
Search shortcut
Hostname
After everyone finishes: compare command choices with a classmate. For any task where you used different commands — which approach is more readable? Which is faster? Are both correct?
Session 32 · Week 8 · Handout G
File operations synthesis — the messy downloads
Name

Date
"You have inherited a colleague's downloads folder. They organized nothing for two years. Files of every type, named randomly, mixed with temporary files and old scripts. Your task: make sense of it using only the terminal. The folder has already been extracted for you."
First command to run: tar -xzf downloads.tar.gz — this extracts the archive. You have not learned tar yet. Just use it. We come back to it in Phase 5.
Log every significant command you run in the log section at the bottom.
1
Design a folder structure
Create it with mkdir. Justify your design in a README file. What categories make sense for the file types you have?
Your structure (draw it here)
2
Move all files into appropriate folders
Use mv and wildcards. Group by type or project. No file should remain unsorted at the end.
Key commands used:
3
Find all .sh files and make them executable
Use find with -exec or chmod with wildcards after locating them.
Command
4
Find the largest file — note it in README
Command
Largest file
5
Find files not modified in the last 30 days → move to archive/
Use find with the -mtime flag. Run ls on the results before mv.
find command
Files found
6
Delete files with "temp" or "tmp" in the name
Run ls first to verify exactly what will be deleted before running rm.
ls command
rm command
7
Write a summary in README using nano
What structure you created, why, what you moved where, what you deleted, and what you would do differently.
commands.log — write every significant command here as you go
Session 36 · Week 9 · Handout H
Combining tools — pipeline builder
Name

Date
Build each pipeline incrementally — run each stage separately first, verify the output, then connect stages with |. Write each stage and what it produces before writing the full pipeline.
sort
sort — alphabetical
sort -n — numeric
sort -r — reverse
sort -u — sort + deduplicate
sort -k2 — sort by field 2
wc
wc -l — count lines
wc -w — count words
wc -c — count characters
uniq
uniq — remove consecutive duplicates
uniq -c — count occurrences
Must sort first!
cut
cut -d: -f1 — field 1 (: delimiter)
cut -d, -f2 — field 2 (, delimiter)
cut -c1-10 — characters 1-10
1.Produce an alphabetically sorted list of all usernames on the system.
Stage 1
produces: list of passwd lines
Stage 2
produces: usernames only
Stage 3
produces: sorted list
Full pipeline
2.Count how many unique login shells are configured in /etc/passwd.
Stage 1
produces: shell field only
Stage 2
produces: sorted shells
Stage 3
produces: unique shells
Stage 4
produces: a count
Full pipeline
Answer
3.Find which login shell in /etc/passwd is used most often.
Hint: cut the shell field, sort it, count occurrences with uniq -c, sort numerically in reverse, take the first result.
Stage 1
Stage 2
Stage 3
Stage 4
Stage 5
Full pipeline
Most common shell
4.Your own: build a pipeline of 3+ commands that answers a question you actually care about. Explain it.
Question you are answering
Full pipeline
What each stage does
Session 40 · Week 10 · Handout I
Phase 2 vocabulary checklist
Name

Date
For each term, tick the green box if you can explain it clearly in your own words. Tick the red box if you need to review it. Be honest — this is for you, not for a grade.
I can explain this clearly
I need to review this
Weeks 5–6 — terminal fundamentals
terminal emulator
shell (bash)
prompt
pwd
ls / ls -la
cd / cd - / cd ~
cat
less (pager)
head -n / tail -n
tail -f (follow)
wc -l
tab completion
Ctrl+R (history search)
!! (last command)
short vs long option
-- (end of options)
man / --help / apropos
man sections (1, 5, 8)
Weeks 7–8 — file operations and finding
mkdir / mkdir -p
touch
echo > (write)
echo >> (append)
cp / cp -r / cp -i
mv (move + rename)
rm / rm -r / rm -rf
rmdir
rm has no undo
nano
Ctrl+O / Ctrl+X
#!/bin/bash (shebang)
find -name / -type
find -size / -mtime
find -exec {} \;
locate / updatedb
grep / grep -r
grep -i / -n / -v / -c
wildcard * ? [abc]
shell expansion (glob)
glob vs regex
Week 9 — pipes and redirection
pipe |
stdin / stdout / stderr
pipeline
> (overwrite)
>> (append)
2> (stderr)
2>&1
/dev/null
regex ^ $ . *
sort / sort -n / -r / -u
uniq / uniq -c
cut -d -f
Week 10 — package manager
package / .deb
repository
sources.list
apt update (index)
apt upgrade
apt install / remove
apt purge
apt autoremove
dependency
signed package / GPG
CVE / security patch
unattended-upgrades
1. What is the single most useful command you learned in Phase 2? Why?
2. What concept was hardest to understand? What finally made it click?
3. Complete: "A pipe | connects ___ to ___. This is useful because ___."
4. What did you install in session 40? Would you install it again?