Lecture 1B

Introduction to the File System

Eric Brauer

Introduction to the File System

History Lesson II

Recall that Linux descended from an operating system designed for mainframes. That is, a single computer being used by many users simultaneously. In the 1980s, personal computers (PCs) became available, which as you can imagine was a revolutionary leap forward! In this case, you had one user working on one computer. Eventually DOS became the most common operating systems for these PCs, and Microsoft Windows was built on (and eventually replaced) DOS.


A Useful Analogy

On Matrix, you have a space which is ‘yours’ for as long as you are a student. You have control over this space. On the other hand, there is a lot that you don’t have control over. The plumbing, the heat, the HVAC, and so on. There is an administrator/superintendant that has authority over these spaces, and who has permission to make changes. The super has authority to create, modify and remove user accounts.


Some Useful Features of the Shell

These aren’t anything you’ll be tested on, but they will absolutely save you time. Please remember this: the shell is a place where accuracy is crucial. A typo will cause your command to not work, or to do something you didn’t want it to. The Tab key is an excellent way of troubleshooting. Here’s how it works:

Let’s go back to the previous example. You are in /home/student. You type in cd D and then press tab once. You won’t see anything occur. You press tab twice. You should see a list of all the matching patterns, in this case both Desktop and Documents will be listed since they both contain D. You continue by typing in o and press tab once again. Your path will be autocompleted, and you should see the complete command cd Documents. Now you can press Enter to complete the command.

Please note that the auto-complete doesn’t unfortunately work when you’re working on Assignments. :( But in the real world, using Tab will speed up your work and also provide a ‘sanity check’ on your commands. If something should be auto-completing and it isn’t, 90% of the time it’s because you’ve made a mistake!


Explore Your “Apartment”


Explore the “Common Space”

The places outside your home folder are common spaces. You can see these places, but you can’t modify them.

ls is a program. And its location is in /bin! So what would happen if a malicious person decided to modify ls for everyone?


You don’t know it yet, but we’ve just demonstrated two different types of filepaths. To see how this works, let’s use a different type of diagram.

tree diagram

Here are Some Rules

The rules for this ‘game’ are simple.


Moving Into a Subdirectory

to subdirectory

Moving Into a Parent Directory

to parent

Moving Into a Sub-Subdirectory

to subdirectory2

Moving Into the Parent of a Parent Directory

to parent2

Lateral Movement

lateral movement

Start From Root (/)

Note: There usually isn’t a /B in Linux systems, so try this with cd /bin instead.

absolute

proper names

The Tree Command

Compare the tree diagrams above with the output from tree:

/
├── sample_dir
│   ├── faculty
│   ├── markham
│   ├── oxford
│   │   ├── programming
│   │   ├── report
│   │   └── security
│   ├── stenton
│   │   ├── gen_ed
│   │   └── lib_arts
│   └── todays-example
└── users
    ├── ebrau
    └── sam

Please feel free to practice navigation by entering the following command:

cd ~eric.brauer/uli101


Summary

Terminology

Commands