BACK TO COMMAND CENTER

TERMINAL SURVIVAL WALL // Andy's Edition v2.0

MacOS • Warp • ZSH • Python • Data Science Workflows

1. NAVIGATION & ORIENTATION

~/Developer/
├── Statistics/
├── Survival_Walls/
├── Machine_Learning/
└── Pandas_Practice/
pwd (Print Working Directory)
pwd
Shows your exact current location.
ls (List)
ls -la
Lists ALL files (even hidden .git) + permissions.
ls -lh
Lists file sizes in KB/MB/GB.
cd (Change Directory)
cd ~/Developer/Machine_Learning
Moves you into the specified folder.
cd ..
Moves exactly ONE folder up.

2. FILES, FOLDERS & ARCHIVES

mkdir / touch
mkdir new_project
Creates a new folder.
touch config.yaml
Creates an empty file instantly.
cp / mv
cp data.csv backup.csv
Duplicates a file.
mv data.csv ./Clean_Data/
Moves a file (or renames it).
zip / unzip
zip -r archive.zip ./my_folder/
Compresses a whole folder recursively.
unzip dataset.zip
Extracts the archive here.
rm -r (Remove Recursive)
rm -r Old_Project_Folder
Deletes folder & EVERYTHING inside FOREVER.
⚠️ DANGER: Bypasses Trash! Check `pwd` first.

3. DATA EXPLORATION (KILLER CMDS)

head (Top Rows)
head -n 5 sales_data.csv
Prints the first 5 rows of a file to the screen.
Use when: Checking CSV headers without opening Excel.
tail (Bottom Rows / Live)
tail -n 10 app.log
Prints the last 10 rows.
tail -f training.log
Follows the file live as new lines are added!
cat (Concatenate)
cat .gitignore
Dumps the entire file content into the terminal.
Use when: Quickly reading small config files.
less (Read Large Files)
less massive_dataset.json
Opens huge files in a scrollable viewer without crashing the terminal. (Press 'q' to quit).

4. SEARCH & DISCOVERY

find
find . -name "*.csv"
Searches current folder (.) for all CSV files.
grep (Search inside files)
grep "import pandas" *.py
Finds exact text string inside all Python files.

5. PYTHON ENVIRONMENTS

Virtual Environment
python -m venv venv
Creates isolated sandbox.
source venv/bin/activate
Turns sandbox ON (Prompt shows `(venv)`).
pip
pip install -r requirements.txt
Installs bulk packages from list.
pip freeze > requirements.txt
Saves your current environment state.

6. HOMEBREW (Mac Package Mgr)

brew install / search
brew install git python
brew search postgresql
Finds and installs system tools.
brew update & upgrade
brew update && brew upgrade
Updates Homebrew itself, then upgrades all tools.
brew doctor
brew doctor
Diagnoses system issues if packages refuse to work.
Use when: "Command not found" after installing.

7. DS LAUNCH & SYSTEM

IDE Launchers
code .
Opens current folder in VS Code.
jupyter lab
Launches Jupyter Lab in browser.
open -a RStudio
Launches RStudio application.
Process Control
top
Live task manager (press 'q' to quit).
kill -9 1234
Force kills frozen process by its PID number.

8. NETWORK & SSH

ping / curl
ping github.com
Checks internet connection stability (CTRL+C to stop).
curl ifconfig.me
Returns your public IP address.
SSH GitHub Auth
ssh-keygen -t ed25519 -C "mail@.com"
Generates a new secure SSH key for GitHub access.
ssh -T git@github.com
Tests if your GitHub SSH connection is working.

9. SUPERPOWERS

  • TAB Autocomplete. Never type full names.
  • CTRL+C Kill Process. Stops a running script.
  • CTRL+L Clear Screen. Pushes clutter out of view.
  • CTRL+R Reverse Search. Finds past commands.
  • Cycle History. Arrow up brings back commands.

10. CORE DS WORKFLOW

1. Project Idea
mkdir new_project
cd new_project
python -m venv venv
source venv/bin/activate
pip install pandas
code .
git init
git add & commit

11. EMERGENCY ZONE

WHAT TO DO WHEN IT'S BROKEN

1. "What did I just break?"
git status
Tells you which files changed or were deleted.
2. "Where the hell am I?"
pwd
Ensure you didn't `cd` into system folders.
3. "What did I just type?!"
history | tail -n 10
Shows your last 10 executed commands.

12. MANTRAS

CHECK WHERE YOU ARE (pwd)
BEFORE YOU DELETE (rm -r)!
THE TERMINAL DOES EXACTLY
WHAT YOU TELL IT TO DO.
NOT WHAT YOU MEANT.