Week 13 · lesson
Linux and Windows CLI: Same Question, Different Tools
Security analysts often move between operating systems. The exact command changes, but the investigative question often stays the same.
Examples:
| Question | Linux example | Windows example |
|---|---|---|
| Where am I? | pwd | cd or Get-Location |
| List files | ls | dir or Get-ChildItem |
| Show user | whoami | whoami |
| View processes | ps | tasklist or Get-Process |
| Search text | grep | findstr or Select-String |
| Network config | ip addr | ipconfig |
Do not treat the table as universal syntax for every shell. Windows Command Prompt and PowerShell are different environments.
Translate the goal, not just the command
Suppose your goal is:
Find all lines containing
ERRORin a supplied log.
Linux might use:
grep "ERROR" app.log
PowerShell might use:
Select-String -Path app.log -Pattern "ERROR"
The syntax differs. The analytical action is the same: filter the evidence for a pattern.
Compare output structure
PowerShell often returns structured objects, while classic Unix-style tools commonly pass text between commands.
That affects how pipelines are built.
You do not need to master PowerShell this week. You need to recognize that a command copied from one shell may not behave the same in another.
Shell-identification challenge
For each prompt, identify the likely environment:
student@labvm:~$
C:\Users\Student>
PS C:\Users\Student>
Then explain why identifying the shell should come before pasting commands from a tutorial.
Cross-platform evidence task
Your teacher provides the same synthetic event dataset in two lab formats.
Answer:
- count error lines
- find events for one fictional user
- identify the latest timestamp
- save an approved filtered result
Document the Linux method and the Windows/PowerShell method side by side.
Command safety comparison
Some commands can be destructive on either platform.
The safe habit is not memorizing a list of "dangerous commands."
Use this decision process:
- What state can this command change?
- Which files, users, processes, or network settings can it reach?
- Is that change required by the lab?
- Is the target explicitly authorized?
- Can I preview or inspect before changing anything?
Build a translation card
Create a one-page reference with ten investigative goals and the approved Linux and Windows/PowerShell equivalents.
For each command, include:
- purpose
- expected output
- whether it changes state
- one common beginner mistake
Evidence for Lesson 2
Submit:
- shell-identification answers
- cross-platform evidence task
- ten-item translation card
- one paragraph explaining why copying a command without identifying the shell is risky
Finish with:
The command name matters less than understanding ________.
A strong analyst can transfer the question across platforms instead of depending on memorized syntax alone.