KhawarNehalkhawarneh
277 views
32 slides
Oct 08, 2021
Slide 1 of 32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
About This Presentation
Linux course fhs file hierarchy standard
Size: 757.06 KB
Language: en
Added: Oct 08, 2021
Slides: 32 pages
Slide Content
File Hierarchy System
Current systems
I listed the / directory on the system I was working
on got this.
bin boot dev etc home lib lib64 lost+found
media mnt opt proc root run sbin sys tmp usr
var
Common FHS
The next slide has a diagram of the common FHS
tree.
Linux Hierarchy System
/ root
Just a single slash ( / ) denotes the root directory.
Some students while learning Unix or Linux are
not able to see the tree and do not ask.
They just accept the term tree.
Directory “tree”
You shall see images like
Where is the tree
Where is the tree
Where is the tree
and
Where is the tree
Directory “tree”
To see the tree and what computer science and
ICT ( information and communications
technology ) people call a tree.
I shall turn the diagram side ways or upside down
so you can “see” the tree they are referring to.
Where is the tree
Where is the tree
No you can see
why this is called
the “root”
Where is the tree
No you can see
why this is called
the “root”
FHS details
Now we shall start with each directory and explain
what is in it.
The File Hierarchy Standard
/bin
Bin is the short form for binary.
When programs are made, they are written in high
level languages which humans can make sense
of.
The examples are PHP, C, Pascal, C++, Python,
and hundreds more.
/bin
These languages are translated into a binary form
which the CPU can run.
The technical term for this translation is compiled.
The technical term for “the CPU can run” is
execute.
Some people refer to them as exe files for short
and this is short for executable.
In Linux and Unix they are called binary files and
bin is used for the short name for the directory.
/bin
So the bin directly contains programs which are
commonly used and are related to the operating
system.
Examples are ls for listing files akin to dir in DOS.
cp for copying files which is like copy in DOS.
/bin
Technically not all files in the bin directory are
compiled files.
There can also be shell scripts in the directory
which are interpreted when they are executed.
This point of shell scripts also goes for other bin
directories like
/sbin, /usr/bin, /usr/sbin
The File Hierarchy Standard
/boot
Due to some technical limitations of the BIOS
(Basic Input Output System) which is software
located on the motherboard. Sometimes it needs
the boot partition to be located near the beginning
of the harddisk (sector zero).
Because of this a separate partition is made and
the /boot directory is located there to allow
support for the BIOS.
/boot
Whether your BIOS needs a separate partition or
not, the startup files for the boot loader of the
operating system shall be located in this /boot
directory.
This is where the executable copy of the kernel
shall be found.
The kernel is the core part of the operating system
which manages ALL of the hardware.
The File Hierarchy Standard
/dev
Almost all of the devices have a device file
associated with them in Linux.
All of the device files are located in the /dev
directory.
If you read or write to a file in this directory, you
shall be actually communicating with a device.
/dev
For example.
if you give the command
cat /dev/audio > /tmp/file.audio
the mic shall be activated and your shall be
recording audio.
Press control C to stop the recording.
/dev
Now if you give the command
cat /tmp/file.audio > /dev/audio
The speakers shall be activated and your shall be
able to hear what was recorded.
The File Hierarchy Standard
/etc
This is where all of the configuration files for
almost all of the softwares are kept.
This way the administrator can backup only a few
megabytes and have a copy of all of the
configuration files of all of the softwares installed.
To restore a system, the administrator only needs
the install all of the software from the CD and/or
the internet and all of the things shall be back as
before.
/etc
If the software is a server and does not use a
database and does not use data files.
And only does caching like proxy servers, DHCP
servers, Routers, and such, they shall work
perfectly.
For other applications which have data and a
database, these files also need to be backed up.
But you avoid having to copy all of the programs
in the bin directories completely.
/etc
If the software is a server and does not use a
database and does not use data files.
And only does caching like proxy servers, DHCP
servers, Routers, and such, they shall work
perfectly.
For other applications which have data and a
database, these files also need to be backed up.
But you avoid having to copy all of the programs
in the bin directories completely.