Mamun Labs Learn
JourneyGlossary
esc
  • Try “map”, “flexbox” or “state”.
Log in
Start learning
Phase 0 · 2 / 6Files, folders and paths
Phase 0Getting started
6 topics · 1–2 wks
  1. 1What a computer actually does
  2. 2Files, folders and paths
  3. 3The terminal, step by step
  4. 4Set up VS Code and Node
  5. 5Git and GitHub basics
  6. 6Using AI as a study partner
JourneyPhase 0Files, folders and paths
01 / 08Overview

Files, folders and paths

You'll learn how files and folders are organised, and how to write the path to any file.

Why it mattersCode opens files, imports other files and runs inside folders. Most "file not found" errors are a wrong path.
about 60 min·needs: What a computer actually does
02 / 08

Watch & read

Start with the required ones. The others are there when you need them.

Article
Dealing with filesMDN Web Docs · 15 min · English
MMamun's noteRead the parts on file names and file paths carefully. The website folder structure part is useful later, so a quick look is enough.
Article
Navigating files and directoriesSoftware Carpentry · 20 min · English
MMamun's noteRead from the start until the section on ls. Look at the tree picture and the home folder paths for Linux, macOS and Windows. The commands come in the next topic.
VideoOptional
Files and file systems: Crash Course Computer Science #20Crash Course · YouTube · 12 min · English
MMamun's noteOnly if you are curious how files are stored on the disk. It is fast. You do not need it to move on.
03 / 08

See it step by step

Walk a relative path one step at a time.

current folder"/Users/rafi/projects/notes/images"
path"../todo.txt"
path.txt
1start in /Users/rafi/projects/notes/images
2..
3todo.txt
You start inside the images folder. A relative path always begins from here.
Step 1 / 4
04 / 08

Explanation

You want to tell the computer exactly where a file is. Saying "it's in my documents somewhere" is not enough. You need its path.

Think of your university. Inside the university is the CSE department. Inside the department is your batch. Inside your batch is your section's class register. Each place sits inside a bigger one. Files work the same way: a folder (also called a directory) holds files and other folders, which hold more. Drawn out, it looks like an upside-down tree.

/Users/rafi/
projects/
notes/
todo.txt
images/
logo.png

A path is the list of folders you walk through to reach a file, joined by /. The absolute path to the to-do file starts from the very top: /Users/rafi/projects/notes/todo.txt. It works from anywhere.

A relative path starts from where you are now. If you are already in notes, the same file is just todo.txt, and the logo is images/logo.png. Two dots, .., mean "go up one folder". From inside images, the to-do file is ../todo.txt.

The part after the last dot, like .txt, .js or .png, is the extension. It tells programs what kind of file it is. Changing notes.txt to notes.js does not change what is inside.

On macOS and Linux paths use / and start at /. Your home folder is /Users/rafi (macOS) or /home/rafi (Linux). On Windows they use \ and start with a drive letter, like C:\Users\Rafi\projects. In code and in web addresses, always use /, even on Windows.

People often name files My Notes.txt or Project Final.js. Spaces break commands in the terminal, and many systems treat Logo.png and logo.png as two different files. Use lowercase and dashes: my-notes.txt, project-final.js.

When you read a path, go left to right: each / is one step into a folder. If it starts with / (or C:\), it starts at the top. If not, ask: where am I starting from?

Words to recognise
filefolderdirectorypathabsolute pathrelative pathextension/..home folder
05 / 08

Quick check

3 questions. Each one explains itself after you answer.

  1. 1 / 3You are in /Users/rafi/projects/notes/images. Where does ../todo.txt point?
  2. 2 / 3Which of these is an absolute path?
  3. 3 / 3Which file name will give you the least trouble?
06 / 08

Explain it back

Only you can see this. Log in to keep it.0 words
07 / 08

How confident are you with Files, folders and paths?

08 / 08

Done

You can now
Read a path like /Users/rafi/projects/notes/todo.txt and say where the file is, and write a relative path from one file to another.
Next: The terminal, step by step Back to Phase 0
On this page
  1. 01Files, folders and paths
  2. 02Watch & read
  3. 03See it step by step
  4. 04Explanation
  5. 05Quick check
  6. 06Explain it back
  7. 07Confidence
  8. 08Done
Up next · 02 / 08Watch & read
Mamun Labs LearnFound a mistake on this page? Tell Mamun.
Mamun Labs Learn
JourneyGlossary
esc
  • Try “map”, “flexbox” or “state”.
Log in
Start learning
Log in to save your progress. Everything here works without an account.Log in to save progressLog in
Phase 0Getting started
6 topics · 1–2 wks
  1. 1What a computer actually does
  2. 2Files, folders and paths
  3. 3The terminal, step by step
  4. 4Set up VS Code and Node
  5. 5Git and GitHub basics
  6. 6Using AI as a study partner
JourneyPhase 0Files, folders and paths
01 / 08Overview

Files, folders and paths

You'll learn how files and folders are organised, and how to write the path to any file.

Why it mattersCode opens files, imports other files and runs inside folders. Most "file not found" errors are a wrong path.
about 60 min·needs: What a computer actually does
02 / 08

Watch & read

Start with the required ones. The others are there when you need them.

Article
Dealing with filesMDN Web Docs · 15 min · English
MMamun's noteRead the parts on file names and file paths carefully. The website folder structure part is useful later, so a quick look is enough.
Article
Navigating files and directoriesSoftware Carpentry · 20 min · English
MMamun's noteRead from the start until the section on ls. Look at the tree picture and the home folder paths for Linux, macOS and Windows. The commands come in the next topic.
VideoOptional
Files and file systems: Crash Course Computer Science #20Crash Course · YouTube · 12 min · English
MMamun's noteOnly if you are curious how files are stored on the disk. It is fast. You do not need it to move on.
03 / 08

See it step by step

Walk a relative path one step at a time.

current folder"/Users/rafi/projects/notes/images"
path"../todo.txt"
path.txt
1start in /Users/rafi/projects/notes/images
2..
3todo.txt
You start inside the images folder. A relative path always begins from here.
Step 1 / 4
04 / 08

Explanation

You want to tell the computer exactly where a file is. Saying "it's in my documents somewhere" is not enough. You need its path.

Think of your university. Inside the university is the CSE department. Inside the department is your batch. Inside your batch is your section's class register. Each place sits inside a bigger one. Files work the same way: a folder (also called a directory) holds files and other folders, which hold more. Drawn out, it looks like an upside-down tree.

/Users/rafi/
projects/
notes/
todo.txt
images/
logo.png

A path is the list of folders you walk through to reach a file, joined by /. The absolute path to the to-do file starts from the very top: /Users/rafi/projects/notes/todo.txt. It works from anywhere.

A relative path starts from where you are now. If you are already in notes, the same file is just todo.txt, and the logo is images/logo.png. Two dots, .., mean "go up one folder". From inside images, the to-do file is ../todo.txt.

The part after the last dot, like .txt, .js or .png, is the extension. It tells programs what kind of file it is. Changing notes.txt to notes.js does not change what is inside.

On macOS and Linux paths use / and start at /. Your home folder is /Users/rafi (macOS) or /home/rafi (Linux). On Windows they use \ and start with a drive letter, like C:\Users\Rafi\projects. In code and in web addresses, always use /, even on Windows.

People often name files My Notes.txt or Project Final.js. Spaces break commands in the terminal, and many systems treat Logo.png and logo.png as two different files. Use lowercase and dashes: my-notes.txt, project-final.js.

When you read a path, go left to right: each / is one step into a folder. If it starts with / (or C:\), it starts at the top. If not, ask: where am I starting from?

Words to recognise
filefolderdirectorypathabsolute pathrelative pathextension/..home folder
05 / 08

Quick check

3 questions. Each one explains itself after you answer.

  1. 1 / 3You are in /Users/rafi/projects/notes/images. Where does ../todo.txt point?
  2. 2 / 3Which of these is an absolute path?
  3. 3 / 3Which file name will give you the least trouble?
06 / 08

Explain it back

Only you can see this. Log in to keep it.0 words
07 / 08

How confident are you with Files, folders and paths?

08 / 08

Done

You can now
Read a path like /Users/rafi/projects/notes/todo.txt and say where the file is, and write a relative path from one file to another.
Next: The terminal, step by step Back to Phase 0
On this page
  1. 01Files, folders and paths
  2. 02Watch & read
  3. 03See it step by step
  4. 04Explanation
  5. 05Quick check
  6. 06Explain it back
  7. 07Confidence
  8. 08Done
Up next · 02 / 08Watch & read

You want to tell the computer exactly where a file is. Saying "it's in my documents somewhere" is not enough. You need its path.

Think of your university. Inside the university is the CSE department. Inside the department is your batch. Inside your batch is your section's class register. Each place sits inside a bigger one. Files work the same way: a folder (also called a directory) holds files and other folders, which hold more. Drawn out, it looks like an upside-down tree.

/Users/rafi/
projects/
notes/
todo.txt
images/
logo.png

A path is the list of folders you walk through to reach a file, joined by /. The absolute path to the to-do file starts from the very top: /Users/rafi/projects/notes/todo.txt. It works from anywhere.

A relative path starts from where you are now. If you are already in notes, the same file is just todo.txt, and the logo is images/logo.png. Two dots, .., mean "go up one folder". From inside images, the to-do file is ../todo.txt.

The part after the last dot, like .txt, .js or .png, is the extension. It tells programs what kind of file it is. Changing notes.txt to notes.js does not change what is inside.

On macOS and Linux paths use / and start at /. Your home folder is /Users/rafi (macOS) or /home/rafi (Linux). On Windows they use \ and start with a drive letter, like C:\Users\Rafi\projects. In code and in web addresses, always use /, even on Windows.

People often name files My Notes.txt or Project Final.js. Spaces break commands in the terminal, and many systems treat Logo.png and logo.png as two different files. Use lowercase and dashes: my-notes.txt, project-final.js.

When you read a path, go left to right: each / is one step into a folder. If it starts with / (or C:\), it starts at the top. If not, ask: where am I starting from?

Words to recognise
filefolderdirectorypathabsolute pathrelative pathextension/..home folder

You want to tell the computer exactly where a file is. Saying "it's in my documents somewhere" is not enough. You need its path.

Think of your university. Inside the university is the CSE department. Inside the department is your batch. Inside your batch is your section's class register. Each place sits inside a bigger one. Files work the same way: a folder (also called a directory) holds files and other folders, which hold more. Drawn out, it looks like an upside-down tree.

/Users/rafi/
projects/
notes/
todo.txt
images/
logo.png

A path is the list of folders you walk through to reach a file, joined by /. The absolute path to the to-do file starts from the very top: /Users/rafi/projects/notes/todo.txt. It works from anywhere.

A relative path starts from where you are now. If you are already in notes, the same file is just todo.txt, and the logo is images/logo.png. Two dots, .., mean "go up one folder". From inside images, the to-do file is ../todo.txt.

The part after the last dot, like .txt, .js or .png, is the extension. It tells programs what kind of file it is. Changing notes.txt to notes.js does not change what is inside.

On macOS and Linux paths use / and start at /. Your home folder is /Users/rafi (macOS) or /home/rafi (Linux). On Windows they use \ and start with a drive letter, like C:\Users\Rafi\projects. In code and in web addresses, always use /, even on Windows.

People often name files My Notes.txt or Project Final.js. Spaces break commands in the terminal, and many systems treat Logo.png and logo.png as two different files. Use lowercase and dashes: my-notes.txt, project-final.js.

When you read a path, go left to right: each / is one step into a folder. If it starts with / (or C:\), it starts at the top. If not, ask: where am I starting from?

Words to recognise
filefolderdirectorypathabsolute pathrelative pathextension/..home folder