<aside> <img src="/icons/home_green.svg" alt="/icons/home_green.svg" width="40px" />

Back to Home

</aside>

Cheat sheet for MAC and Windows

1. Understanding File Paths & Navigation

Common Terminal Commands:

Command Description Example
pwd Shows current location (path) /c/Users/YourName/Desktop
lsordir Lists files in current folder
cd foldername Move into a folder cd Documents
cd .. Move up one level(go back)
cd ~ Go to your home directory
cd / Go to the root directory
clearorcls Clear the terminal screen

TIP: If a folder or file name has spaces, use:


2. File Paths Cheat Sheet

You want to... Command
Go to Desktop cd ~/Desktoporcd C:\Users\YourName\Desktop
Go to Downloads cd ~/Downloads
Back to previous folder cd ..

Check You're in the Right Place

Action Command Sample Output
Check current directory pwd /c/Users/YourName/Projects
List all files (including hidden) ls -la drwxr-xr-x .git/-rw-r--r-- index.html-rw-r--r-- style.css
Find specific files find . -name "*.js" ./src/app.js./src/utils.js
Check if you're in git repo git status On branch mainYour branch is up to date

3. Compile and Run C Code

If using GCC (MinGW) or WSL/Git Bash:

gcc hello.c -o hello      # Compile
./hello                   # Run (note the dot-slash!)

Why ./hello and not just hello?


4. Basic Git Commands

Before using Git, make sure you are in the correct folder.

Action Command
Check where you are pwd
List files ls
Start Git in folder git init
Check Git status git status
Add all changes git add .
Commit changes git commit -m "Your message"
Connect remote repo git remote add origin &lt;url&gt;
Push to GitHub git push -u origin main