Research Computing | Linux File System Structure

Video
Transcript or Alternate URL: 

Intro 
This video is the first in a series that will help instruct you how to use the Linux Operating System. This series will help you master key concepts, such as 'understanding the Linux terminal interface', 'navigating the Linux filesystem', and 'using common Linux commands'. This video on the Structure of the Linux Filesystem will provide you with the foundation necessary for understanding these key concepts, that will be covered in future videos.

Linux File System Structure – Slide 2 (slide) 
The key to understanding the Linux file system structure is to realize that it has been designed to group files by their function and not
necessarily by their content.

Linux File System Structure – Slide 3 (slide) 
With other computing platforms, data is stored by type or by content. Programs are stored in their own folders with their configuration files. User configurations and preferences are stored within a single object in the system. Windows even stores all of the files that make up the operating system in a folder named 'C:\Windows'. 

Linux File System Structure – Slide 4 (slide) 
Linux is just a bit different in that it breaks out those parts and put them in a pre-defined location. 
For example, all of the important configuration files are stored in one location. All documentation is stored in a separate location, and programs are in yet another different location. Any input/output that is required by the program is stored in yet another pre-defined
location. 

Linux File System Structure – Slide 5 (slide) 
This helps to prevent confusion about the purpose of different parts that make up the whole of the program. This is especially useful when accessing other computers, as many of the common programs, or help documents, will be located in the exact same place on different system.
To help solidify these concepts, we will draw some analogues with the Windows File System, since most people areeveryone are already
familiar with it.

Linux File System Structure – Slide 6 (slide) 
Windows computers typically have a 'C:\' drive, which is written as c-colon-backslash (C:\). When we look at a file's location in Windows, or we discuss the 'path' of a local file, we typically see it begin with those same three letters: 'C:\'. This is known as the 'root' of the filesystem. In fact, we typically refer to this location as the
'filesystem root'. 
This corresponds to the 'forward-slash (/)' designation in Linux. The full pathname of every file in Linux will begin with a '/' character, denoting the root of the filesystem. We will discuss absolute and
relative paths in a later video. 

Linux File System Structure – Slide 8 (slide) 
Personal files in the Windows Operating System are typically stored within the 'C:\Users' directory. In Linux, this directory is called the 'home directory' and is located at '/home'. Some of your personal preference and configuration files are also stored in this location. 
When a program is installed within Windows, the install location is typically within the 'C:\Program Files' directory. The entire application is stored in this location, potentially including any configuration files, documentation, libraries, and – in general – anything that is required to make the program run. 

In the Linux File System Structure, programs are typically installed
to the '/usr/bin' directory. Let's break it down to see what these things stand for:  'usr' stands for user, meaning that this is a location where users of the system can find things. 
 'bin' stands for 'binary', which is a somewhat archaic term for a
program. If we put it all together, we get an "absolute" path: '/usr/bin' 
Documentation is placed into the '/usr/share/doc' directory -- 'share' referring to a place where files are shared, and 'doc' referring to documentation. Unfortunately, there is no corresponding folder within
the Windows directory hierarchy. 

There are other locations within the Linux filesystem that contain important data. Configurations are stored within the '/etc' (typically pronounced et'sy) directory, whereas configurations for Windows programs may be in any number of locations, including the Windows registry, the program directory, or other locations. 
One other major location is the '/var' directory. This location is for systems to read and write various types of data. For example, websites for the Apache web server, a popular Linux web server, stores its web pages in the '/var/www/html' directory. 
Log files from various programs are stored in '/var/log', and temporary files are often kept in the '/var/tmp' directories. 

Closing Remarks (outro slide) 
This video has introduced you to the structure of the Linux File System. This is a crucial concept that we will be building upon in our next videos, so please be sure that you understand the material presented before continuing. In our next session, we will be looking at how to navigate the filesystem structure using a Linux Terminal
Interface.