The Linux File System: Operating Systems 1
The Linux File System: Operating Systems 1
The Linux File System: Operating Systems 1
Operating Systems 1
1
Data Storage on Linux
All data are stored on disk (physical representation) as
files
Linux hides the physical representation by imposing a
logical structure on the data storage
The Linux operating system logical structure for data
storage is the file system
A user of the Linux operating system is unaware of the
physical representation of data, they need only concern
themselves with the logical structure view
2
Physical and Logical Views
DISC SYSTEM
ADMINISTRATORS VIEW
/ (root)
LOGICAL LAYER OF THE DATA STORAGE
3
The Logical View
The file system is the part of the Linux operating
system that is responsible for the storage of data
– All data is stored in Files
The files in the Linux operating system are organised in
a directory structure
– A directory can contain files
– A directory can contain other directories
– A directory can contain both files and other
directories
4
Very Important Distinction
5
The Directory Tree
/ (root)
users
students staff
f1 A file f2 A file
6
Paths through the File System
7
Tracing the path of a file
/ (root)
users
f1 A file f2 A file
8
Absolute Paths
/home/users/staff/phil/f1
/home/users/staff/nathan
9
Relative Paths
These are paths that trace the root between
the current working directory and the file you
wish to describe
Here are two examples with a working
directory of /home/users/
staff/phil/f1
staff/nathan
10
Hypothetical Linux File System
/ (root)
Nathan is logged on to his HOME directory,
consequently, his current working directory
home is /home/users/staff/nathan
users
The absolute pathname to file3 is
students staff /home/users/staff/nathan/letters/file3
11
You never get to see everything
Users only get to see a small part of the file
system
Only administrators see all files from root
onwards
When you log on to Linux you can see from
home onwards
In other words partial branches of the directory
tree (depends on your access rights)
12
So when Logging On
13
Contents of Working Directory
14
The ‘ls’ command
/ (root)
home
file2
file2 file3
15
Changing the Working Directory
16
The Change Directory command
/ (root)
Rebecca's HOME directory has
the following absolute
home
pathname
Rebecca’s Home users /home/users/students/rebecca
Directory and
Working directory students staff If Rebecca wished to change
from her HOME directory to the
phil nathan file1
rebecca cara
directory containing the file
code letters HelloWorld.java then she would
Rebecca’s new
java
Working directory need to use the cd command
file2
notes code file2 file3
17
The commands to use
COMMAND LINE DESCRIPTION
> cd /home/users/students/rebecca/java/code cd is the command and
/home/users/students/rebecca/java/code
is the argument (absolute path)
> cd java/code cd is the command and
java/code is the argument (relative path)
> cd cd is the command with no argument
takes you back to your home directory
> cd / cd is the command and
/ is the argument (absolute path again)
> cd . cd is the command and
. is the argument (refers to current working
directory so does nothing)
> cd .. cd is the command and
.. Is the argument moves up to next level in
directory tree (short for parent of working
directory)
18
The whole tree
19
Using the On-Line manual
The man command used to describe in detail
the operation of all other commands in the
Linux Operating System i.e.
20
Final Exit
21
Two Applications to access Linux
22
Summary of File System Concepts
23
Summary of OS Commands
24