System Commands OPPE: Syllabus, grep/sed/awk & Preparation
A practical guide to clearing the IIT Madras BS System Commands online proctored programming exam — grep, sed, awk, shell scripting and exam-day tips.
The System Commands OPPE is a live, terminal-based exam: you're handed text files, logs or CSV-like data and asked to extract, transform or summarise them with one-liners and short Bash scripts. Little is theory — almost everything is "produce this output from that input." Practise until the syntax is muscle memory on the System Commands practice set.
What commands come in the System Commands OPPE?
The high-frequency toolkit is grep, sed, awk, cut, tr, plus pipes (|), redirection (>, >>, 2>), find, sort, uniq, wc, head/tail, and chmod. Weeks 4–7 (regex/find, scripting, awk/sed, log processing) are where most exam marks sit.
grep / sed / awk tips that actually score
- grep: learn
-E(extended regex),-i,-v(invert),-c(count),-o(only the match),-r, and anchors^/$with classes[0-9]. Many "count lines containing X" questions are a singlegrep -c. - sed: master
sed 's/old/new/g', in-place-i, deletionsed '/pattern/d', range printingsed -n '2,5p', and backreferences\1. - awk:
awk -F',' '{print $2}'for fields,NR/NFfor counts,BEGIN{}/END{}blocks, conditions likeawk '$3 > 100', and column sums ({s+=$2} END{print s}).
Keep the GNU sed and GNU awk manuals open while you drill.
Shell scripting doubts
Scripts trip people up on small syntax, not logic. Nail down the shebang #!/bin/bash, positional args $1, $@, $#, the spaces inside [ "$a" -eq 1 ], for/while loops, case, and exit statuses. Test what happens with no arguments — graders often check edge cases. Since scripting overlaps with general programming, brushing up logic on the Python practice track helps.
Common mistakes
- Forgetting the
gflag onsedand only replacing the first match per line. - Wrong
awkdelimiter — defaulting to whitespace when the file is comma- or colon-separated. - Using basic-regex
grepwhen the pattern needsgrep -E. - Quoting errors — unquoted
$variablesand globbing surprises. chmodconfusion between octal (755) and symbolic (u+x) modes.- Overwriting input with
>before you've verified the pipeline.
Exam-day tips
Read every question fully before touching the keyboard, and build pipelines incrementally — get grep right, then pipe to cut, then to sort. Use man (it's allowed) but don't browse aimlessly. Verify output against exactly what's asked (trailing spaces and case matter for auto-grading). Do the easy grep/cut questions first to bank marks, then return to the awk/scripting ones. See where practice puts you on the leaderboard.
FAQ
Is the System Commands OPPE only shell, or Python too? It's overwhelmingly Linux shell/Bash. Some tasks touch general scripting logic, but the core is grep, sed, awk and Bash.
Can I use man pages during the exam? Yes — the terminal and its manual pages are available. Practise looking up flags quickly.
Which weeks matter most? Weeks 4–7: regex/find, shell scripting, awk/sed, and log processing.
How do I practise realistically? Work on real files in a terminal under time pressure, not by reading notes. Use the System Commands practice module.
Where's the official info? The official IITM BS Data Science program and GNU coreutils manual.