00 Quiz: Terminal and CLI Foundations
March 2026 (2720 Words, 16 Minutes)
New: Interactive Quiz Available!
Want to track your progress and get instant feedback? Try our new interactive version with progress tracking, immediate explanations, and score calculation.
Instructions
- This quiz tests your understanding of key concepts from Appendix 0 Part 1 (Terminal and CLI Foundations)
- Each question has 4 options with exactly one correct answer
- Try to answer without referring to the lecture materials
- Focus on understanding concepts, not memorizing details
Question 1: What Is a Terminal?
What is a terminal in the context of modern computing?
A) A text-based interface where you type commands and the computer responds with text
B) A physical keyboard connected to a mainframe computer
C) A graphical application for browsing the internet
D) A special mode inside your web browser for running system commands
Show Answer
Correct Answer: A
A terminal is a text-based interface – essentially a text conversation with your computer. You type commands, and the computer responds with text output. While terminals were originally physical devices (option B) in the 1960s-70s, today they are software programs called “terminal emulators” that simulate that same text-based interaction. They are not graphical browsers (C), and while some browsers have developer consoles, a terminal is a standalone application (D).
Question 2: Terminal vs. Shell
What is the difference between a terminal application and a shell?
A) They are the same thing – “terminal” and “shell” are interchangeable terms
B) The terminal handles local input and output on your machine; the shell runs commands on a remote server
C) The shell is the window; the terminal is the command interpreter
D) The terminal is the window you see on screen; the shell is the program running inside it that interprets your commands
Show Answer
Correct Answer: D
The terminal application is the window (handling text display, colors, fonts, scrolling). The shell is the program running inside that window that interprets your commands and communicates with the operating system. The lecture uses an analogy: the terminal is the phone (the device), and the shell is the language you speak on the phone. Option C reverses the correct definitions, and option A ignores a distinction that matters when troubleshooting or configuring your environment.
Question 3: Default Shells
Which shell is the default on macOS (since Catalina 2019)?
A) bash
B) PowerShell
C) zsh
D) Command Prompt
Show Answer
Correct Answer: C
Since macOS Catalina (2019), the default shell is zsh. Before that, macOS used bash. Linux distributions typically default to bash, and Windows defaults to PowerShell. Command Prompt (cmd.exe) is not a shell in the Unix sense – it is the legacy Windows command interpreter.
Question 4: Windows Terminal Options
Which terminal/shell combination is recommended for this course on Windows?
A) Command Prompt (cmd.exe) because it is the oldest and most stable
B) PowerShell because it is the modern Windows default and most widely supported
C) WSL (Windows Subsystem for Linux) because it provides a complete Linux environment
D) Git Bash because it provides bash syntax that matches Linux/macOS commands
Show Answer
Correct Answer: D
Git Bash is recommended because it provides a bash shell on Windows, so commands like ls, cd, cat, grep work the same as on Linux and macOS. This is important because the vast majority of tutorials, Stack Overflow answers, and documentation use bash syntax. WSL (C) is an advanced option not needed for this course. PowerShell (B) uses different syntax, and Command Prompt (A) is legacy.
Question 5: The VS Code Terminal
When you see multiple shell options in the VS Code terminal dropdown (PowerShell, Git Bash, Command Prompt), what does each option do?
A) Each option opens the same terminal window but with a different shell running inside it
B) Each option opens a completely different terminal application with its own window and settings
C) Each option connects to a different remote server where your commands are actually executed
D) Each option opens a different programming language environment for writing and running code
Show Answer
Correct Answer: A
Every option in the VS Code terminal dropdown opens the same terminal window but with a different shell running inside it. This is the terminal vs. shell distinction in action – the VS Code terminal is the terminal application, and you choose which shell (PowerShell, bash, etc.) runs inside it. You can even have multiple terminal tabs open side by side, each running a different shell.
Question 6: Bash vs. Zsh
What is the practical difference between bash and zsh for a beginner taking this course?
A) They use completely different command sets and syntax rules – you must learn both separately
B) Bash only works on Linux; zsh only works on macOS
C) They understand the same core commands – the differences only matter for advanced customization
D) Zsh is significantly faster than bash and is always the preferred choice
Show Answer
Correct Answer: C
Bash and zsh are both Unix shells that understand the same core commands: cd, ls, mkdir, rm, cat, echo, grep, and hundreds more. If you learn bash, you effectively know zsh too for everyday use. The differences (zsh has better tab completion, spelling correction, and customization) only matter for advanced usage. The lecture advises: “do not spend time choosing a shell right now.”
Question 7: The Prompt Symbol
When a tutorial shows $ git status, what should you type?
A) $ git status (including the dollar sign)
B) git status (without the dollar sign)
C) > git status (with a greater-than sign instead)
D) run git status (with the run prefix)
Show Answer
Correct Answer: B
The $ at the beginning is the prompt – it indicates that the terminal is ready for your next command. You do not type it yourself. You only type git status and press Enter. Different shells use different prompt symbols ($ for bash, % for zsh, > for PowerShell), but they all serve the same purpose: “I am ready for your next command.”
Question 8: File Paths
What does the ~ symbol represent in a file path like cd ~/Documents?
A) The root directory of the file system
B) The parent directory (one level up)
C) The current directory
D) Your home directory
Show Answer
Correct Answer: D
The ~ (tilde) is a shortcut for your home directory (/home/user on Linux, /Users/user on macOS, C:\Users\user on Windows). So cd ~/Documents means “go to the Documents folder inside my home directory.” The root directory is / (option A), the parent directory is .. (option B), and the current directory is . (option C).
Question 9: Command Syntax
In the command git commit -m "Add README file", what is -m?
A) A subcommand that tells git which action to perform
B) An argument providing data to the command
C) A flag (option) that modifies the command’s behavior
D) The program being executed
Show Answer
Correct Answer: C
In the command structure git commit -m "Add README file", -m is a flag (also called an option) that modifies the command’s behavior. Specifically, -m tells commit that the next value is the commit message. Without -m, git would open a text editor for you to write the message. git is the program (D), commit is the subcommand (A), and "Add README file" is the argument (B).
Question 10: Short vs. Long Flags
What is the relationship between -m and --message in git?
A) They are completely different flags that modify different aspects of the commit behavior
B) -m is the short form and --message is the long form – they do exactly the same thing
C) --message is deprecated and should not be used
D) -m is the Linux/macOS variant, while --message is the Windows-specific equivalent
Show Answer
Correct Answer: B
Most flags have two forms: a short form (single dash + one letter, like -m) and a long form (double dash + a word, like --message). They do exactly the same thing. Short flags are faster to type; long flags are easier to read. This pattern is consistent across most CLI tools, not just git.
Question 11: PATH Environment Variable
What is the PATH environment variable?
A) The current working directory that determines where your terminal session is located
B) A list of folders that the shell searches through to find programs when you type a command
C) The complete file path pointing to a specific program’s installation folder on disk
D) A configuration setting that controls which files are visible when you list directory contents
Show Answer
Correct Answer: B
The PATH is an environment variable that contains a list of folders. When you type a command like git, the shell searches through these folders in order until it finds a program with that name. The lecture compares it to a phone book: the shell looks up the name you typed in a list of known addresses. If the program’s folder is not in PATH, you get “command not found.”
Question 12: Command Not Found
You type ruff check and get “command not found.” What is the MOST LIKELY cause?
A) The ruff program does not exist and has never been released
B) The program is installed but incompatible with your current shell
C) The program is not installed, or its folder is not in your PATH
D) You need to use PowerShell instead of bash for this command
Show Answer
Correct Answer: C
“Command not found” does not mean the program does not exist in general – it means the shell cannot find it. The most common causes are: (1) the program is not installed, or (2) the program’s installation folder is not in your PATH. A third common cause is that you installed the program but did not restart the terminal – many installers add to PATH, but the change only takes effect in new terminal windows.
Question 13: Programs Are Files
What actually happens when you “install” a program on your computer?
A) Files are copied to your hard drive and (usually) the program’s location is added to PATH
B) The program is compiled into your operating system’s kernel
C) The program’s source code is stored and recompiled each time you run it
D) The program is downloaded and runs directly from the internet each time you launch it
Show Answer
Correct Answer: A
A program is simply a file on your hard drive that contains instructions your computer can execute. Installing a program means copying files to your hard drive and typically adding the program’s folder to your PATH so the shell can find it. Running a program means the operating system reads the file and follows the instructions inside. There is no magic involved – no kernel compilation (B), no recompilation on each run (C), and no internet streaming (D).
Question 14: Compiled vs. Interpreted
Why do you need to install Python before you can run .py files, but you can run git directly?
A) Python requires more system resources, so a separate runtime manager must handle memory allocation
B) Git is a compiled program that runs directly; Python scripts need an interpreter to read and execute them line by line
C) Git can auto-detect your operating system, but Python requires manual platform configuration
D) Python files must be converted to .exe format before execution, which requires an installer
Show Answer
Correct Answer: B
Git is a compiled program – its source code was translated into machine code once by a compiler, producing a standalone executable file. The computer runs it directly. Python scripts are interpreted – the source code is read and executed line by line by another program called an interpreter. The .py file is not an executable on its own; you need the Python interpreter installed to run it: python my_script.py means “tell the Python interpreter to read and run this file.”
Question 15: Programs vs. IDE Extensions
You install the “Python” program on your computer AND the “Python” VS Code extension. Why do you need both?
A) The program is the engine that runs code; the extension is a bridge that makes the program’s output visible inside VS Code
B) They are redundant – installing either one gives you full Python functionality in VS Code
C) The extension contains its own built-in Python interpreter, making the standalone program unnecessary
D) The program handles execution in the terminal, while the extension handles execution in the browser
Show Answer
Correct Answer: A
The program (e.g., python, ruff, git) is the actual tool that does the work in the terminal. The IDE extension is a bridge between VS Code and the program – it calls the program behind the scenes and displays the results inside VS Code (syntax highlighting, error underlining, autocomplete). The extension does not contain a Python interpreter (C); it talks to the installed program. If you install the extension but forget the program, VS Code will show an error saying it cannot find a Python interpreter.
Question 16: Why Automation Matters
What is the main advantage of saving terminal commands in a script file instead of typing them one at a time?
A) Scripts run faster because they bypass the shell and communicate directly with the operating system
B) Scripts provide built-in error handling that prevents commands from ever failing
C) Scripts are mandatory in professional environments because they provide audit trails and compliance records
D) Scripts enable repeatability – you can run the same sequence without typos, and edit one file to change the process
Show Answer
Correct Answer: D
The key advantage of scripts is repeatability and maintainability. A script does exactly what you did manually, but faster, without typos, and repeatably. If you need to create 10 projects, you run the script 10 times. If you need to change the setup process, you edit one file instead of remembering a sequence of commands. This principle underlies all modern automation: pre-commit hooks, CI/CD pipelines, test runners, and linters. Scripts do not bypass the shell (A) or prevent all errors (B).
Scoring Guide
- 15-16 correct: Excellent! You have a strong grasp of terminal and CLI fundamentals
- 11-14 correct: Good understanding! Review the areas you missed, particularly the distinctions between terminals, shells, and PATH
- 7-10 correct: Fair understanding. Revisit the lecture sections on terminal vs. shell, PATH, and command syntax
- Below 7: Please review the appendix carefully. These concepts are the foundation for everything in the course. Reach out if you need clarification!
Key Takeaways to Remember
- Terminal = Window, Shell = Language - The terminal is the application; the shell (bash, zsh, PowerShell) interprets your commands inside it
- Use Git Bash on Windows - It provides cross-platform bash commands that match Linux/macOS
- Commands Follow a Pattern -
program subcommand --flag argumentis consistent across all CLI tools - Don’t Type the Prompt - The
$,%, or>symbol is the prompt, not part of the command - PATH Is a Search List - The shell searches PATH folders in order to find programs; “command not found” means the folder is not in PATH
- ~ Is Home, . Is Here, .. Is Up - These path symbols are essential for navigation
- Short Flags = Long Flags -
-mand--messagedo the same thing; short is faster, long is clearer - Programs Are Just Files - Installing means copying files and updating PATH
- Compiled vs. Interpreted - Git runs directly; Python scripts need the Python interpreter
- Extensions Call Programs - VS Code extensions are bridges to terminal programs, not replacements
Remember: The terminal is not an outdated relic – it is the foundation of modern software development. Servers, CI/CD pipelines, deployment systems, and professional tools all run through text commands. Mastering the terminal means understanding how the entire software development pipeline works!