๐ Navigation & Discovery
Orient yourself in the terminal. These are the tools to figure out exactly where you are and what is around you.
| Action | Bash (Mac/Linux) | PowerShell (Windows) |
|---|---|---|
| Print Working Directory | pwd | Get-Location (or pwd) |
| List Files & Folders | ls | Get-ChildItem (or ls / dir) |
| Change Directory | cd | Set-Location (or cd) |
| Go Back One Folder | cd .. | cd .. |
| Go to Home Directory | cd ~ | cd ~ |
| Clear the Screen | clear | Clear-Host (or clear / cls) |
# Jump straight from your home directory into your coursework folder cd ~/Documents/SNHU_Projects/Software_Engineering # Verify exactly where you landed pwd # List everything in this folder, including hidden config folders like .git ls -la
# You are 5 folders deep and want to back out quickly # Go up one folder... cd .. # Go up TWO folders at once! cd ../../ # Terminal getting messy? Wipe it clean. clear
๐ File & Folder Manipulation
The bread and butter of terminal work. Manage your project assets and scripts without ever touching a mouse.
| Action | Bash (Mac/Linux) | PowerShell (Windows) |
|---|---|---|
| Make a Directory | mkdir | mkdir (or New-Item -ItemType Directory) |
| Create Empty File | touch | ni (or New-Item) |
| Copy a File | cp | cp (or Copy-Item) |
| Copy a Folder | cp -r | Copy-Item -Recurse |
| Move / Rename | mv | mv (or Move-Item) |
| Delete a File | rm | rm (or Remove-Item) |
| Delete a Folder | rm -rf | Remove-Item -Recurse -Force |
# Create multiple folders at the exact same time mkdir Scripts Prefabs Audio Materials # Create two empty C# scripts instantly inside the Scripts folder touch Scripts/GameManager.cs Scripts/AnimalController.cs
# Copy a crucial UI script before making risky changes cp UI_Controller.cs UI_Controller_BACKUP.cs # Move a completed track into the Teq Vault music release folder mv Towards_The_Light_Mix1.wav ../Releases/ # Oops, spelled it wrong. Let's rename it using the move command! mv Towards_The_Light_Mix1.wav Towards_The_Light_Final.wav
# Delete a single old test build file rm QUETIEMALS_Alpha_v1.apk # FORCE delete an entire folder and everything inside it (No undo!) rm -rf Old_Test_Project/
๐ Searching & Viewing
Quickly find specific lines of code or track down missing scripts directly from the command line without opening your IDE.
| Action | Bash (Mac/Linux) | PowerShell (Windows) |
|---|---|---|
| View File Contents | cat | cat (or Get-Content) |
| Search Inside Files | grep | sls (or Select-String) |
| Find a File by Name | find . -name | Get-ChildItem -Filter -Recurse |
| View Log Updates | tail -f | Get-Content -Wait |
# Check what dependencies your Python project needs without opening VS Code cat requirements.txt
# BASH: Find every line where the word "health" appears in the AnimalManager script grep "health" AnimalManager.cs # BASH: Find the word "biome" across ALL scripts in the current folder (case-insensitive) grep -ri "biome" . # POWERSHELL equivalent for the above sls "biome" *.cs
# BASH: Find all custom OpenGL shader files nested anywhere inside this project find . -name "*.glsl" # POWERSHELL equivalent for finding files Get-ChildItem -Filter "*.glsl" -Recurse
โ๏ธ System & Processes
Crucial commands for troubleshooting when an IDE hangs, or a local server port won't close.
| Action | Bash (Mac/Linux) | PowerShell (Windows) |
|---|---|---|
| Show Running Processes | top or htop | gps (or Get-Process) |
| Kill a Process | kill <PID> | Stop-Process -Id <PID> |
| Check Network IP | ifconfig or ip a | ipconfig |
| Test Connection | ping | ping (or Test-Connection) |
# POWERSHELL: PyCharm has totally frozen. Find its process ID (PID) gps -Name "pycharm*" # Let's say the PID is 14032. Force quit it. Stop-Process -Id 14032 -Force # BASH: Same thing, finding the process top # Then kill it kill -9 14032
# Find your local IP Address (useful for testing mobile games on your local WiFi) # WINDOWS: ipconfig # MAC/LINUX: ifconfig # Test if your server (or the internet) is actually responding ping google.com
๐งโ๐ป Developer Workflow
The daily routines. The most frequent command strings you'll use for version control and virtual environments.
Python VENVs
Bash: source venv/bin/activate
PS: .\venv\Scripts\Activate.ps1
Exit: deactivate
Dependencies
Install your project requirements:pip install -r requirements.txt
Pro-Tip: Chaining
Use && to run commands back-to-back.git add . && git status
# 1. Check what files you've modified today git status # 2. Stage all the changes to be saved git add . # 3. Commit the changes with a highly descriptive message git commit -m "Refactored PyMongo CRUD module and updated Jupyter notebook tests" # 4. Push to the remote repository (GitHub, GitLab, etc.) git push origin main
# 1. Create a brand new virtual environment named "venv" python -m venv venv # 2. Turn it on (Windows PowerShell example) .\venv\Scripts\Activate.ps1 # 3. Install packages safely inside the bubble pip install pymongo # 4. Turn it off when you're done for the day deactivate
cd QUE) and hit TAB. The terminal will auto-complete it for you. Also, use the Up Arrow to cycle through previously typed commands!