Comprehensive · CLI

Terminal Mastery:
Bash & PowerShell

Stop relying on the mouse. Learn how to command your computer with absolute precision and speed. ⚡

⭐ ⭐ ⭐ ⭐ ⭐
📚 Your Progress
0%
Module 1 of 8

🧠 The Command Line Philosophy

Why write commands when you can just click buttons? Let's talk about power, speed, and why professionals live in the terminal.

🍎 Real World Analogy

Using a Graphical User Interface (GUI) like Windows Explorer or macOS Finder is like ordering from a restaurant menu. You can only choose what the chef has decided to put on the page.

Using the Command Line Interface (CLI) is like walking straight into the kitchen. You have access to raw ingredients, all the tools, and can cook exactly what you want, however you want it.

💡 Why Learn the Terminal?
  • Speed: Once you build muscle memory, creating 10 folders with a single command takes 2 seconds. Doing that with a mouse takes a minute.
  • Automation: You can't schedule a mouse click easily, but you can write a script to back up your Unity project every night at 2 AM automatically.
  • Server Management: When deploying games or web apps to production servers (like AWS or Google Cloud), there usually is no GUI. It's just you and a blinking text cursor.
🧠 Quick Check!
What is the primary advantage of the CLI over a GUI?
Module 2 of 8

⚔️ Bash vs PowerShell

The two titans of the terminal world. They look similar, but their underlying architectures are vastly different.

🐧 Bash (Bourne Again Shell)

The standard for Linux and macOS. Bash is fundamentally text-based. When a command outputs information, it spits out raw text strings. If you want to process that data, you have to cut, slice, and filter that text.

🪟 PowerShell

Created by Microsoft for Windows (though now cross-platform). PowerShell is fundamentally object-oriented. When a command runs, it doesn't output text; it outputs rich data objects (like C# or Java objects) with properties and methods.

🤝
The Good News: Aliases! PowerShell knows that developers love Bash commands. So, Microsoft built "aliases" into PowerShell. If you type ls (a Bash command) in PowerShell, it secretly translates it to Get-ChildItem. This means much of your muscle memory will work seamlessly across both!
Module 3 of 8

🗺️ Navigating the Maze

Before you can build anything, you need to know how to move around your computer's file system efficiently.

🧭 The Navigation Toolkit
CommandWhat it doesExample
pwdPrint Working Directory. Tells you exactly where you are.pwd
lsLiSt. Shows all files and folders in your current location.ls -la (shows hidden files)
cdChange Directory. Moves you into a target folder.cd Documents/
cd ..Moves you UP one level in the folder structure.cd ../../ (moves up two levels)
Terminal — Academic Workflow
# Let's navigate to a specific software engineering assignment
cd ~/SNHU_Projects/CS210_Programming_Languages

# Check what is currently inside the folder
ls

# Output:
# Assignment1.py   README.md   Testing_Module/

# Move into the testing module
cd Testing_Module/
🧠 Quick Check!
If you are lost in the terminal and want to know your exact current folder path, which command do you use?
Module 4 of 8

📂 File Forging

Creating, moving, copying, and destroying files without taking your hands off the keyboard.

🔨 The Builder's Toolkit
  • mkdirMaKe DIRectory (creates a folder).
  • touch — Creates an empty file (Bash). In PowerShell, use ni.
  • cpCoPy a file. (Use cp -r for folders).
  • mvMoVe a file. This is also how you rename files!
  • rmReMove a file. Warning: Does not go to the recycle bin!
Terminal — Game Studio Workflow
# Scaffolding the asset structure for a new game
mkdir QUETIEMALS_Assets
cd QUETIEMALS_Assets

# Creating multiple sub-folders at once
mkdir AnimalCharacters BiomeEnvironments Audio

# Creating an empty C# script for character behavior
touch MovementController.cs

# Moving a newly produced music track into the correct folder
mv ../Downloads/Towards_The_Light_BGM.wav Audio/
⚠️
The Danger Command Typing rm -rf folder_name will forcefully and recursively delete a folder and everything inside it permanently. Use this command with extreme caution.
Module 5 of 8

🔍 Data Detective

How to look inside files and search through massive codebases instantly.

🔎 Search & View Commands
  • cat — Concatenate. Prints the entire contents of a file directly to the terminal.
  • grep (Bash) / sls (PowerShell) — Searches inside files for specific words or patterns.
  • find — Searches for files by name across entire directories.
Terminal — Finding Lost Code
# BASH: You know you wrote a custom shader, but forgot where it is.
# Find all files ending in .glsl in the current folder and below.
find . -name "*.glsl"

# POWERSHELL: You need to find exactly where you defined "baseHealth"
# Search all C# scripts for that exact word.
sls "baseHealth" *.cs

# Output:
# AnimalStats.cs:14:    public int baseHealth = 100;
# CombatManager.cs:42:  int currentHP = target.baseHealth;
🧠 Quick Check!
If you want to print the contents of a `requirements.txt` file to the screen without opening a text editor, what command do you use?
Module 6 of 8

⚙️ Process Control

Taking command of your system's resources, especially when software crashes or networks act up.

🖥️ System Commands
ActionBashPowerShell
View running appstop or htopGet-Process (gps)
Force quit an appkill <PID>Stop-Process -Id <PID>
Check network infoifconfigipconfig
Terminal — Unfreezing an IDE
# PyCharm has completely frozen while indexing. Let's kill it via PowerShell.
# Step 1: Find the process
gps -Name "pycharm*"

# Output shows the ID is 9042.
# Step 2: Terminate it forcefully.
Stop-Process -Id 9042 -Force
🛑
The Emergency Brake: Ctrl + C If you run a script that gets stuck in an infinite loop, or you start a local testing server and need to shut it down, press Ctrl + C. It sends an interrupt signal to stop whatever is currently running in the terminal.
Module 7 of 8

🧑‍💻 The Developer Routine

The combinations of commands you will use every single day as a software engineer.

🔗 Command Chaining

You can tell the terminal to run multiple commands back-to-back using &&. The second command will only run if the first one succeeds.

Terminal — The Git Workflow
# The classic sequence to save your code to a repository
git status
git add .
git commit -m "Refactored PyMongo database connection class"
git push

# Doing the same thing in one chained line!
git add . && git commit -m "Update DB" && git push
Terminal — Python Virtual Environments
# Setting up an isolated environment for a project
python -m venv venv

# Activating it (Windows PowerShell)
.\venv\Scripts\Activate.ps1

# Installing dependencies
pip install pymongo
🚀
The Greatest Trick: Tab Completion Never type a full folder or file name again. Type the first few letters (e.g., cd PyM) and hit the TAB key. The terminal will auto-complete it to PyMongo_Project/. Use the Up Arrow to recall your previous commands!
Module 8 of 8 — Final Assessment 🏆

🏆 Terminal Master!

You've learned the philosophy, the syntax, and the real-world applications of the Command Line Interface.

📋 Core Concepts Recap
  • Navigation: pwd, ls, cd
  • Manipulation: mkdir, touch, cp, mv, rm
  • Investigation: cat, grep, find
  • Control: top, kill, Ctrl+C
🏆 Final Mastery Quiz!
You want to move a file named `hero.png` into a folder named `Assets`, and then clear your terminal screen. What chained command does this?