CMPSC 100 Computational Expression
File systems organize data in a tree-like structure
Family relationships describe folder connections:
red
is the parent of yellow
and orange
green
and purple
are children of yellow
yellow
and orange
are siblingsgreen
and purple
are siblingsDirectory = Folder (same thing!)
The root directory contains everything else:
red
is the root directoryA path shows the route to a specific file or folder:
/
(forward slash) to separate foldersExamples from our tree: ::: {.incremental} - Path to purple
: red/yellow/purple
- Path to orange
: red/orange
- Path to green
: red/yellow/green
:::
Two main ways to explore your files:
Important: Be careful with cloud storage - files might not be locally stored!
VS Code has a built-in terminal - perfect for our work!
Ctrl/Cmd + Shift + P
→ “Terminal: Create New Terminal”Benefits:
The terminal is a text-based interface to your computer:
Why use terminal?
Key commands for navigation:
pwd
- Print Working Directory (where am I?)ls
- List files and folderscd
- Change DirectoryEssential commands for moving around:
List contents:
ls -l
for detailed viewls -a
to show hidden filesChange directory:
Making new directories:
Examples:
mkdir homework
mkdir "my documents" # Use quotes for spaces
mkdir project1 project2 project3 # Create multiple
Best practices:
cmpsc100_f2025
, lab1
File and directory operations:
Helpful shortcuts to remember:
.
(dot) = Current directory..
(dot dot) = Parent directory~
(tilde) = Home directory/
(forward slash) = Root directoryExamples:
Getting comfortable with the terminal:
clear
command or Ctrl+L
Safety tips:
rm
(delete) commandsls
to check contents before moving