Class 2B - Introduction to the File System

CommandPrompt CommandPrompt

Lecture Outline

1. Announcements (10 mins)

2. The File System (30 mins)

Announcements

  • Lab 1 will be due Saturday September 18, 2021 at 6 PM

  • My office hours will be 30 minutes after every class on Monday, Wednesday, and Friday 15:00 - 15:30

  • Lab sessions will be on Zoom, find the link to your Zoom link on Canvas.

../../../_images/zoom2.png

File System

The file system organizes data on a device as a hierarchy of directories and files (like a tree). Each folder (AKA directory) has a name and can contain any number of files or subdirectories. Each file has a name. The user can change (navigate) directories in the hierarchy.

File System

File System

The tree is rooted at, well, the root.

  • There is only one root of a directory hierarchy. Every item in the tree is either a file or a directory (AKA folder).

  • You can think of a directory as a container that may contains files and/or other directories.

  • Files on the other hand hold information (and cannot contain other files or directories) .

If directoryC is contained in directoryP, then directoryC is a child of directoryP and directoryP is said to be the parent to directoryC.

  • A directory may have many children, but can only have one parent.

Absolute versus Relative Path

  • The root of the file system is the directory “/”

  • There is only one root of a directory hierarchy.

  • A path to a new location (from your current location) can be specified as an absolute path from the root (this will work no matter where we are in the file system):

Activity: Let’s try to re-create that directory and file structure

You will need the following commands:

  • cd : change directory

  • pwd : print working directory

  • mkdir: make directory

  • ls: list directory contents

  • touch: create an empty file with a specific name

  • code: edit the file in the VS Code editor

display(Markdown('#### Supplementary video on absolute vs. relative paths'))

IFrame('https://www.youtube-nocookie.com/embed/sqX6hu7oEew',width="100%",height="500px")

System Message: WARNING/2 (/home/runner/work/data301_course/data301_course/notes/week02/Class2B/Class2B.ipynb, line 1)

Non-consecutive header level increase; 0 to 4 [myst.header]

That’s it! See you Next Class!