Data in Trees

Structuring and Navigating Files

Welcome to Stat 133 Lab

As you come in, please drop your index card from lecture on the front desk or fill out a new card using the same prompt:

On one side of your card write answers to the following questions (borrow a pen from a neighbor if needed):

  1. What is your lab number? (integer)
  2. How many years have you been at Cal? (integer)
  3. Are you a Statistics major? (true / false)

On the other side of the card write answers to the following questions:

  1. What was your “song of the summer”? (character string)
  2. What is the farthest that you were from Cal this summer in miles? (numeric)

Introductions

01:00

About the Course

Syllabus

05:00

Please take 5 minutes to read the syllabus and jot down at least two questions that you have.

Discussion forum: Ed

Course website

berkeley-stat133/fall-2025

Data on Trees

boardwork

Terminology

File

A named container that stores data – such as text, images, or programs – on a computer disk. The file name usually ends in an extension (.txt, .png) that indicates the format.

Example

127.txt
Golden Klaxons
3000?

Directory (or folder)

A named container that stores a set of files or other folders.

How should we organize our cards into directories?

Boardwork.

How can we specify the location of a file/directory in the tree?

Path

A description of a file or directory’s location in the file system, written as a sequence of folder names that leads to it, separated by /.1

Absolute path: Starts from the root of the file system, indicated by /. Example: /Documents/Schoolwork/HW1.pdf

What absolute paths are found in our tree?

Path

A description of a file or directory’s location in the file system, written as a sequence of folder names that leads to it, separated by /.

Absolute path: Starts from the root of the file system, indicated by /. Example: /Documents/Schoolwork/HW1.pdf

Relative path: Starts from the current directory and shows how to reach a target. .. means “go up one level”. Example if you’re in Documents, Schoolwork/HW1.pdf

What relative paths are found in our tree?

Practicing on a computer

UNIX1 Commands

pwd

Returns your present working directory.

ls

Lists the contents of your present working directory.

cd

Changes your directory to the path provided (after a space). Examples:

  • cd Homework: (relative) only takes you into the Homework directory if you’re in Documents.
  • cd /Document/Homework: (absolute) takes you into the Homework directory regardless of your pwd.

cat

Prints to the screen the contents of the file at the path provided. Example: cat 127.txt.

DataHub

We will practice on a sample of our index cards on a cloud-hosted machine that has a directory containing sample of our index card files.

Login Here:

https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fberkeley-stat133%2Fdata-in-trees&urlpath=tree%2Fdata-in-trees%2F&branch=master

Practice

10:00