DS105 2025-2026 Autumn Term Icon

📝 W03 Formative

File Systems, Terminal Commands, and Python Control Flow

Author

Dr Jon Cardoso-Silva

Published

15 October 2025

🎯 Learning Goals
By the end of this exercise, you should be able to: i) Navigate file systems confidently using Terminal commands. ii) Understand the difference between plain text and binary files. iii) Use basic Terminal text editors and file viewing commands. iv) Apply loops and conditionals to solve data problems. v) Connect command-line skills to professional data science workflows.
Note

Ideally, everyone should finish this exercise before the 🖥️ W03 Lecture!

This practice exercise should take about 2-3 hours to complete. If you found the W02 DataQuest coding challenging, this week gives you a chance to take a breather! You’ll learn about how computers organise files and some essential professional skills before we return to more Python coding in Task 4.

Think of this as building your toolkit with different kinds of tools.

Briefing

Duration 2-3 hours. This week builds essential professional skills!
📂 Folder to Use in Nuvolos week03/
💎 Key Learning Concept How to navigate files and read different file formats

💡 Learning Together:

This week’s exercise introduces professional skills that every data scientist needs. The Terminal can feel unfamiliar at first, and this is completely normal! We encourage you to:

  1. Take your time with each section - these are foundational skills
  2. Ask questions in the #help channel on Slack if you get stuck
  3. Work with classmates to understand the concepts together

Remember that the best way to learn in DS105 is to learn by doing and asking questions whenever you get stuck.

Desired Output

At the end of this exercise, you should have created the following structure inside your Nuvolos workspace:

/files/
├── week01/ (from previous weeks)
├── week02/ (from previous weeks)  
└── week03/
    ├── W03-NB01-reflections-and-dataquest.ipynb
    └── data/
        └── [any data files you create during practice]

Your notebook should contain:

  • Reflections on the Shell-it game experience
  • Notes on Terminal commands you learned
  • Documentation of three DataQuest lessons (loops and conditionals)
  • (optional)Your solution to the advanced challenge (revisiting the W01 Lab algorithm)

Task 1: Shell-it Game

Time estimate: 20 minutes

Before diving into real Terminal commands, let’s build your intuition about file navigation through an interactive experience.

🎯 ACTION POINTS

  1. Play “Shell-it: The London Episode” for at least 10 locations.

    Visit the Shell-it game and navigate through London landmarks using command-line style instructions. You’ll learn cd (change directory) and ls (list contents) in a fun, low-pressure environment.

    Created by Riya Chhikara

    Class Teacher

    Riya built this interactive game to help you learn Terminal navigation in a playful way. Thanks, Riya!

  2. Observe patterns: Each landmark has an absolute and relative path, just like files on your computer.

  3. Take a screenshot of your final location in the game and save it to your computer. You’ll upload this to your week03/ folder later to show you know how to handle and organise files.

    Here’s how to take a screenshot on Windows or Mac.

Task 2: Create Your Notebook & Reflect

Time estimate: 15 minutes

Before jumping into the Nuvolos Terminal, let’s create a notebook where you can document your reflections and learning.

🎯 ACTION POINTS

  1. Open Terminal in VS Code

    • On VS Code, click on the Menu icon then navigate to Terminal > New Terminal.
  2. Check where you are:

    Whenever you open a Terminal, you are always in a specific folder. To check where you are, type:

    pwd

    On Nuvolos, you should be in /files/ by default. This is your “home” folder.

In a ‘normal’ computer, your home folder will typically be something like C:\Users\<your-username> on Windows or /Users/<your-username> on Mac.

  1. See what folders exist:

    ls

    You should see your week01 and week02 folders from previous weeks.

  2. Create your week03 folder (if it doesn’t exist yet):

    mkdir week03

    Then verify it was created:

    ls
  3. Navigate into week03:

    cd week03

    Confirm you’re there:

    pwd
  4. Create a data subfolder:

    mkdir data
    ls

    You should see your new data/ folder.

  5. Create your notebook file using touch:

    touch W03-NB01-reflections-and-dataquest.ipynb
    ls

    You should now see your new notebook file listed.

Tip

Cross-platform note: touch creates empty files on Mac/Linux. On Windows PowerShell, you’d use New-Item instead. This is one of the differences between operating systems.

  1. Open the notebook in VS Code

    Click on the W03-NB01-reflections-and-dataquest.ipynb file in VS Code’s file explorer (left panel) to open it.

  2. Add a professional header

    Create a Markdown cell at the top of your notebook with content a header similar to this:

    # 📝 Week 03 Practice – File Systems and Python Control Flow
    
    **LSE DS105A – Data for Data Science (2025/26)**
    
    - 📅 Date: [Add today's date]
    - 👤 Name: [Add your name]
    - 🎯 Purpose: Learn Terminal navigation and Python loops/conditionals
  3. Add your Shell-it reflection

    Create a new Markdown cell with a section heading and write your reflection (3-5 sentences):

    • How does navigating the London landmarks in Shell-it relate to navigating files on a computer?
    • What patterns did you notice about the commands?
    • What was confusing or surprising?

Task 3: Terminal Skills

Time estimate: 30 minutes

Let’s explore what else you can do from the Terminal. In the olden days, computers did not have a mouse and you could not click and drag stuff around. The only way to interact with files was to use the Terminal and run applications. It might not feel like it yet, but this skill is still very relevant today.

🎯 ACTION POINTS

  1. Navigate to read CSV files

    Use cd with relative paths to navigate from wherever you are now to /files/week01/data/. Remember you can use pwd to check where you are and ls to see what’s around you.

    Need help with relative paths?

    If you’re in /files/week03/, you can use:

    cd ../week01/data/

    The .. means “go up one level” (to the parent folder).

  2. Read a CSV file with cat

    Once you’re in /files/week01/data/, try:

    cat london_heatwaves_by_year_1990_2025.csv

    Readable, right? CSV files are plain text, just like code files.

  3. Navigate to root and edit README

    Navigate back to /files/ and use ls to see if there’s a README.md file there.

    cd /files/
    ls

    If you see README.md, open it with the nano text editor:

    nano README.md

    How to use nano

    nano is a plain text editor that works in your Terminal. Think of it as a 🦖 dinosaur version of Google Docs or VS Code.

    • Use arrow keys to move around
    • Type normally to edit
    • Ctrl + X to exit
    • Press Y to save your changes
    • Press N to discard changes
    • Ctrl + O then Enter to save to a different filename

    Your task: Make changes to the README so it has your personal touch! You can either rewrite it entirely or just add to it.

    It could be as simple as adding a list of relevant links you need to visit regularly when you are on Nuvolos.

    Here’s an example

    Maybe I would add a link to the Dataquest or Slack channels or Claude:

    ---
    
    ## 🔗 Quick Links
    
    - [Dataquest](https://app.dataquest.io/)
    - [Slack](https://lse-ds105-2025-26-at.slack.com/)
    - [Claude](https://claude.ai/project/01990f03-4acd-748a-b8c4-b08c9cf9127c)

    Save and exit (Ctrl + X, then Y, then Enter), then verify your changes:

    cat README.md

    You should see your new section at the bottom.

  4. 💡 Lightbulb moment? Have you ever wondered what a Jupyter Notebook looks like deep down?

    Navigate to where one of your Jupyter notebooks lives (week01 or week02) and use cat to look inside it. For example:

    cd week01
    cat W01-NB01-heatwave-analysis.ipynb

    Add a reflection in your W03-NB01 notebook:

    Navigate back to VS Code and create a new Markdown cell. Write about what you see when you cat a Jupyter notebook file. What patterns do you notice? What does the structure remind you of from your W02 DataQuest lessons? (Hint: think about the Python data structures you’ve learned.)

  5. Upload your Shell-it screenshot

    Remember the screenshot you took during 🎯 Task 1? Let’s upload it now.

    In VS Code, right-click on your week03/ folder and select Upload. Upload the screenshot you saved earlier.

    Name it something simple like shell-it-screenshot.png so it’s easy to find.

  6. Binary files experiment

    Now let’s use that screenshot you just uploaded to understand the difference between text and binary files.

    Navigate to your week03 folder (if you’re not there already):

    cd /files/week03

    Try to look at what’s inside your screenshot using cat:

    cat shell-it-screenshot.png

    Gibberish! This is because images are binary files (not plain text). They’re meant to be read by image viewers, not humans reading text.

    Add a reflection in your notebook: What’s the difference between plain text files (CSV, Python scripts, Jupyter notebooks) and binary files (images, PDFs)? Why can you read some files with cat but not others?

  7. Document what you learned and what you remain curious about

    Create a new section in your W03-NB01 notebook called “Terminal Commands I Learned” and document the commands from this task. You can format this however you like - as a table, a list, or prose.

Task 4: DataQuest & Advanced Challenge

Time estimate: 60 minutes

Now back to Python! Complete these three DataQuest lessons in your W03-NB01 notebook:

🎯 ACTION POINTS

  1. Complete three DataQuest lessons:

  2. Document your learning as you go:

    Follow the same approach you used in 📝 W02 Practice:

    • Create section headers for each lesson
    • Include code examples that demonstrate key concepts
    • Add your personal notes about what clicked or what confused you

Engage! 🗣️ 💬

As you work through this week’s tasks, feel free to share observations or questions in the #help channel on Slack.

The teaching team monitors Slack regularly and other students often have helpful perspectives.

💭 Here’s something to think about: How do Terminal commands relate to the Python code you write? Both are ways of telling a computer what to do, but they operate at different levels. What makes them different?


🔖 Appendix

Support this week:

  • Slack: Post questions to #help and help each other out! Staff will check Slack at specific times during the week.
  • Office Hours: You can book a 1:1 session with the teaching staff via StudentHub. Just search for our names there.