Вы находитесь на странице: 1из 27

Hidaya Institute of

Science &
Technology
www.histpk.org
A Division of Hidaya Trust, Pakistan

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org
File System Hierarchy

M N Jatt

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 2
File System Structure
• A file system is the methods and data structures
that an operating system uses to keep track of
files on a disk or partition; that is, the way the files
are organized on the disk.
• A file system organizes the data in an efficient
manner and is tuned to the specific
characteristics of the device.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 3
FSSTND
• The FSSTND (Filesystem Standard), a
filesystem hierarchy standard specific to the Linux
operating system, was released on 14 February
1994.
• The name has been changed into Filesystem
Hierarchy Standard (FHS) on 26 October 1997.
• Initial release 1.0 14 February 1994.
• Latest release 2.3 29 January 2004.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 4
Filesystem Hierarchy Standard

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 5
What is a File?
• Files are collection of data items stored on disk.
Or, it's device which can store the information,
data, music (mp3 files), picture, movie, sound,
book etc.
• In fact what ever you store in computer it must be
in the form of a file.
• Files are always associated with devices like hard
disk, flash drive ,floppy disk, CD/DVD etc.
• File is the last object in your file system tree.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 6
What is a File?
• "On a UNIX system, everything is a file; if
something is not a file, it is a process."
• A Linux system, just like UNIX, makes no difference
between a file and a directory, since a directory is
just a file containing names of other files.
• Programs, services, texts, images, and so forth, are
all files.
• Input and output devices, and generally all devices,
are considered to be files, according to the system.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 7
What is a directory?
• Directory is a group of files. Directories are used
to organize your data, files, programs more
efficiently.
• Root directory - There is only one root directory
in your system, which is denoted by / (forward
slash).
• It is root of your entire file system and can not be
renamed or deleted.
Sub directory - Directory under root (/) directory
is sub directory.
M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 8
/ - Root
• The topmost member of this hierarchy is the root
directory, and it is denoted by the symbol /
(slash)
• Only root user has write privilege under this
directory.
• Note: that /root is root user’s home directory,
which is not same as /.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 9
/bin - User Binaries
• The bin directory contains several useful
commands that are of use to both the system
administrator as well as non-privileged users.
• It usually contains the shells like bash, csh, etc…
and commonly used commands like cp, mv, rm,
cat, ls, df, du, wc, tar etc.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 10
/boot - Boot Loader Files
• This directory contains everything required for the
boot process.
• Contains the kernel and other files used during
system startup.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 11
/dev - Device Files
• Contains device files.
• Contains file system entries which represent
devices that are attached to the system to
function.
• These include devices, usb, or any device
attached to the system like hda1, hda2 or
/dev/cdrom.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 12
/etc - Configuration Files
• This is the nerve center of your system, it
contains all system related configuration files in
here or in its sub-directories.
• A "configuration file" is defined as a local file used
to control the operation of a programs.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 13
/home - Home Directories
• Home directories for all users to store their
personal files.
• Linux is a multi-user environment so each user is
also assigned a specific directory that is
accessible only to them and the system
administrator.
• ~ tilde symbol is represents the home directory of
login user on command line.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 14
/lib - System Libraries
• The /lib directory contains kernel modules and
those shared library images (the C programming
code library) needed to boot the system and run
the commands in the root filesystem.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 15
/lost+found
• Linux should always go through a proper
shutdown. Sometimes your system might crash or
a power failure might take the machine down.
• fsck will go through the system and try to recover
any corrupt files that it finds.
• Used by fsck to place orphaned files (files without
names).

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 16
/media - Removable Media Devices
• This directory contains the mount points for
removable media, such as diskettes, CD-ROMs,
and USB flash drives.
• For examples,
• /media/cdrom for CD-ROM
• /media/floppy for floppy drives
• /media/flash for usb flash drive

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 17
/mnt - Mount Directory
• Temporary mount directory where we can mount
the filesystems.
• This is a mount point under which you mount your
filesystems or devices.
• Mounting is the process by which you make a
filesystem available to the system.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 18
/opt - Optional add-on Applications
• This directory is reserved for all the software and
add-on packages that are not part of the default
installation.
• Directory where optional files and programs are
stored.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 19
/proc - Processes
• It is very special in that it is also a virtual
filesystem.
• It's sometimes referred to as a process
information pseudo-file system. It doesn't contain
'real' files but runtime system information (e.g.
system memory, devices mounted, hardware
configuration, etc).
• For this reason it can be regarded as a control
and information center for the kernel.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 20
/root - Home Directory of root
• This is the home directory of the System
Administrator, 'root'.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 21
/sbin - System Binaries
• Just like /bin, /sbin also contains binary
executables.
• But, the Linux commands located under this
directory are used typically by system
administrator, for system maintenance purpose.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 22
/usr - User Programs
• Contains binaries, libraries, documentation, and
source-code for second level programs.
• User programs like telnet, ftp, etc.... are also
placed here.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 23
/var - Variable Files
• Contents of the files that are expected to grow
can be found under this directory.
• This includes
• System log files (/var/log)
• Packages and database files (/var/lib)…

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 24
/srv - Service Data
• Contains server specific services related data.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 25
/tmp - Temporary Files
• Directory that contains temporary files created by
system and users.
• This directory contains mostly files that are
required temporarily.

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 26
The End

M N Jatt © Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org 27

Вам также может понравиться