SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
File System Discovery

           -
Question ?

What do you know
      about

  File System ?
What is file system ?

> Method of storing and organizing computer files
and their data.
> Essentially, it organizes these files into a
database for the storage, organization,
manipulation, and retrieval by the computer's
operating system.


   Eg:- fat, ntfs, ext4, ext3.......
What is file system hierarchy ?


To put it simply, it can be visualized as
    a tree with its roots and all.
At the top of the hierarchy is invariably
   the root path which is represented by '/' and all other directories
    are created beneaththis root path in linux.
Different from Windows

Windows starts with drives, which are
explicit
– C:
– D:
Root !!

In Windows, every drive has its own root C:
is the root of the C drive
In Linux, there is only one root, no matter
how many drives you may have
– In Linux, / is the root
Root is ambiguous in one respect, since it can
refer to the top of the file structure, and is
also the name of the Administrator type
account in Linux.
Attention

Windows uses a backslash for everything
Linux uses a forward slash for everything
In Windows, the logical drive (e.g. C:) is an
important part of the directory structure
In Linux, logical drives don't mean much. You can
even mount a separate
physical drive under a directory that is on another
drive.
In Windows, case does not matter
In Linux, everything is case sensitive.
Drives vs. directories


In Windows, drives are directories

In Linux, you can have several drives

all under one overall directory
Standard?


Distros can vary, but so can programs

When you install a program, it may not follow
the FHS in deciding where to place its files
/

This is the symbol for the root of the file
system in Linux
Every directory is “under” root, ultimately
This is not the same as the user “root”, which
is the user with God-like powers over the
system
The user “root” does have a directory, called /
root
Let’s Zoooooooooooom
/bin

Contains many of the commands used on the
command line
Examples include cat, chmod,dmesg, kill, ls,
mkdir more, ps, pwd, sed, su
the above commands, and many others,
must be in /bin to meet the standard.
Other commands can be optionally included,
such as tar. gzip, netstat, and ping
/boot

Contains files needed for boot
 – kernel
 – Grub menu (good to know if you are
dualbooting)
 – Lilo boot sector backups
Contains data that is used before the kernel
starts executing user-mode programs
/dev

Kinda-sorta an equivalent to a mashup of the
Device Manager and C:WindowsSystem in
Windows

Contains a file describing every device, and
these files can send data to each device

In Linux, everything is a file or a directory
/dev 2

hda1, hda2, etc. are partitions on the first
physical IDE drive
sda1, sda2, etc. are partitions on the first
physical SATA drive

/dev/cdrom is the optical drive
/dev/fd0 is the floppy drive, if you have one
/dev/dsp is the speaker device
/etc

Perhaps the most important to understand

No binaries can be here, per the standard

This is just for configuration files

Examples include /etc/inittab, /etc/fstab ,
/etc/passwd , /etc/hosts, /etc/x11, and /etc/opt
/etc 2

These files are generally text files and can be
edited using any text editor:emacs or vi on
the command line, or whatever graphical
equivalent (e.g. gedit, kate) your desktop
offers
/etc/inittab

Describes what takes place at bootup Includes
the runlevel of the system, and which
processes should be run at each runlevel

Linux has seven runlevels, from 0-6
/etc/fstab

Automatically mounts file systems across
multiple drives or partitions, or even from
remote systems

This file tells the system what drive to access,
and where to mount it in your system
/etc/fstab

Automatically mounts file systems across
multiple drives or partitions, or even from
remote systems

This file tells the system what drive to access,
and where to mount it in your system
/etc/hosts

This is the famous hosts file, which matches
up names with IP addresses

This is like level 1 DNS. The system looks here
first.

This can be used to block sites by putting
their URL in here
/etc/passwd

This is the password file, but it contains more:
user name, user password, user ID, group ID,
home directory, and shell.
It can optionally contain the user's “real
name”
Each user is on its own line
Each user can select the shell they want to
use (most use bash these days)
/etc/opt/


This is a directory for the configuration files
for each system application you install.

Each application gets its own subdirectory
under /etc/opt/
/etc/x11

Configuration directory for x11, which is the
display system for graphical interfaces in
Linux
This can vary with different distros, so again
you need to check
/etc/x11/xorg.conf is the configuration file
that lets you specify the resolutions your
monitor and graphics card can display, for
instance
/home

This is where the home directories for all of
the “ordinary” users are located.
The exception is root, which has its own home
directory, /root/
Each user gets a directory with their user
name: e.g. /home/devmix
This can contain configuration files for
applications that are user-specific
/home Partition?

Your home directory is where you
would place all of your documents, videos,
MP3s, etc.
It can get fairly large
It is also the stuff you want to back up, and
you don't want to lose
Putting it on its own partition, or even its own
physical drive, is not a bad idea
Reinstalling


If you have a separate /home partition, you
can reinstall (or do a clean upgrade) and still
keep not only your data, but many of your file
configurations
/lib

This is the location for shared library files that
are used by system programs
Shared library files are equivalent to Windows'
“*.dll” files
The files here are intended to be libraries for
programs in /bin and /sbin, i.e. needed to
boot the system and run the commands in the
root file system
/lib 2



Also in this directory are kernel modules

Other library locations for other programs
include /usr/lib and /usr/local/lib
/media, /mnt

Either directory can be a place to mount
removable media (e.g. CD, USB drive, Floppy
disk)
/mnt is the older way, and is still used for
temporarily-mounted file systems
Most current distro versions will mount these
devices automatically
/opt


Intended as a place for “optional” software,
i.e. add-on packages that are not part of the
default installation
/proc

Have we mentioned that everything in Linux is
a file or a directory?

Any time a process is created in Linux, a
corresponding file goes in here

Gosh, what would happen if you deleted a file
here?
/root


Home directory for the root account

Normally, you don't want to be root, and you
don't want to go here
/sbin

Place for System binaries
One of three such directories
– /sbin
– /usr/sbin
– /usr/local/sbin
All three hold utilities used for system
administration, and are intended for the root
user like for booting, restoring, recovering,
and/or repairing the system
/tmp

Guess what this one is?
Yes, temporary files are placed here
Assume that anything in this directory will be
deleted whenever the system is booted
If you want to have your own temporary
directory and not lose files at reboot, create
one in your home directory, i.e.
/home/username/temp
/usr

Lots of stuff in here
Back in the mists of prehistory, these were
the user directories, equivalent to what are
now /home directories
Now /usr is for shareable data
Not intended for software packages, in
general
/usr/bin

Contains executable files for many Linux
commands
These are commands that are not part of the
core Linux operating system
They would go in /bin
Examples of commands in here: perl, python
/usr/include



General use include files, including header
files, for C and C++ programming languages
/usr/lib

Contains libraries for the C and C++
programming languages

Object files, libraries, and internal files not
intended to be executed directly by users or
shell scripts
/usr/local


For use by System Administrator when
installing software locally
Must not be over-written when system
software is updated
Generally has same subdirectories as /usr
/usr/sbin


Non-essential standard system binaries, i.e.
utilities

Essential utilities go in /sbin
/usr/share/man


Primary location for man pages for the system
/usr/src


Source code is placed here, for reference
purposes only

This includes the source code for the Linux
kernel
/var

This is for files that are expected to be
updated and changed

This includes:
– mail directories
– print spool
– logs
– web sites
/var 2


Because these can be written to constantly,
they can grow over time
On a server, you may want to put /var on its
own partition to limit the growth
This can also prevent the /var directory from
bringing down the server by using up all of
the drive space.
/var/lock


Contains lock files
These files prevent two users (or two
programs) from trying to access the same
data at the same time
You may need to delete a lock file from time
to time
/var/log



Contains the log files generated by programs
The end ☺

Weitere ähnliche Inhalte

Was ist angesagt?

File system discovery
File system discovery File system discovery
File system discovery DevMix
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Vu Hung Nguyen
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file systemRai University
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigationhetaldobariya
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchysritolia
 
Xfs file system for linux
Xfs file system for linuxXfs file system for linux
Xfs file system for linuxAjay Sood
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentalsRaghu nath
 
Lamp
LampLamp
LampReka
 
Browsing The Source Code of Linux Packages
Browsing The Source Code of Linux PackagesBrowsing The Source Code of Linux Packages
Browsing The Source Code of Linux PackagesMotaz Saad
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 

Was ist angesagt? (19)

linux file system
linux file systemlinux file system
linux file system
 
File system discovery
File system discovery File system discovery
File system discovery
 
Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools Nguyễn Vũ Hưng: Basic Linux Power Tools
Nguyễn Vũ Hưng: Basic Linux Power Tools
 
Mca ii os u-5 unix linux file system
Mca  ii  os u-5 unix linux file systemMca  ii  os u-5 unix linux file system
Mca ii os u-5 unix linux file system
 
Ppt
PptPpt
Ppt
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchy
 
Unix training session 1
Unix training   session 1Unix training   session 1
Unix training session 1
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Xfs file system for linux
Xfs file system for linuxXfs file system for linux
Xfs file system for linux
 
Linux course fhs file hierarchy standard
Linux   course   fhs file hierarchy standardLinux   course   fhs file hierarchy standard
Linux course fhs file hierarchy standard
 
Unix File System
Unix File SystemUnix File System
Unix File System
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Lamp
LampLamp
Lamp
 
Browsing The Source Code of Linux Packages
Browsing The Source Code of Linux PackagesBrowsing The Source Code of Linux Packages
Browsing The Source Code of Linux Packages
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
File Management
File ManagementFile Management
File Management
 
File system
File systemFile system
File system
 

Ähnlich wie File system discovery

File system hiearchy
File system hiearchyFile system hiearchy
File system hiearchysritolia
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Tushar B Kute
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Basic linux architecture
Basic linux architectureBasic linux architecture
Basic linux architectureRohit Kumar
 
Lamp1
Lamp1Lamp1
Lamp1Reka
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Ahmed El-Arabawy
 
Tahir Ashraf [Linux file system herarchy].pptx
Tahir Ashraf [Linux file system herarchy].pptxTahir Ashraf [Linux file system herarchy].pptx
Tahir Ashraf [Linux file system herarchy].pptxSayedtahirAshraf
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
 

Ähnlich wie File system discovery (20)

File system hiearchy
File system hiearchyFile system hiearchy
File system hiearchy
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Unix file system.pptx
Unix file system.pptxUnix file system.pptx
Unix file system.pptx
 
Basic linux architecture
Basic linux architectureBasic linux architecture
Basic linux architecture
 
Lamp1
Lamp1Lamp1
Lamp1
 
Lamp1
Lamp1Lamp1
Lamp1
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux
 
Tahir Ashraf [Linux file system herarchy].pptx
Tahir Ashraf [Linux file system herarchy].pptxTahir Ashraf [Linux file system herarchy].pptx
Tahir Ashraf [Linux file system herarchy].pptx
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux file
Linux fileLinux file
Linux file
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 

Kürzlich hochgeladen

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

File system discovery

  • 2. Question ? What do you know about File System ?
  • 3. What is file system ? > Method of storing and organizing computer files and their data. > Essentially, it organizes these files into a database for the storage, organization, manipulation, and retrieval by the computer's operating system. Eg:- fat, ntfs, ext4, ext3.......
  • 4. What is file system hierarchy ? To put it simply, it can be visualized as a tree with its roots and all. At the top of the hierarchy is invariably the root path which is represented by '/' and all other directories are created beneaththis root path in linux.
  • 5. Different from Windows Windows starts with drives, which are explicit – C: – D:
  • 6. Root !! In Windows, every drive has its own root C: is the root of the C drive In Linux, there is only one root, no matter how many drives you may have – In Linux, / is the root Root is ambiguous in one respect, since it can refer to the top of the file structure, and is also the name of the Administrator type account in Linux.
  • 7. Attention Windows uses a backslash for everything Linux uses a forward slash for everything In Windows, the logical drive (e.g. C:) is an important part of the directory structure In Linux, logical drives don't mean much. You can even mount a separate physical drive under a directory that is on another drive. In Windows, case does not matter In Linux, everything is case sensitive.
  • 8. Drives vs. directories In Windows, drives are directories In Linux, you can have several drives all under one overall directory
  • 9. Standard? Distros can vary, but so can programs When you install a program, it may not follow the FHS in deciding where to place its files
  • 10. / This is the symbol for the root of the file system in Linux Every directory is “under” root, ultimately This is not the same as the user “root”, which is the user with God-like powers over the system The user “root” does have a directory, called / root
  • 12.
  • 13. /bin Contains many of the commands used on the command line Examples include cat, chmod,dmesg, kill, ls, mkdir more, ps, pwd, sed, su the above commands, and many others, must be in /bin to meet the standard. Other commands can be optionally included, such as tar. gzip, netstat, and ping
  • 14. /boot Contains files needed for boot – kernel – Grub menu (good to know if you are dualbooting) – Lilo boot sector backups Contains data that is used before the kernel starts executing user-mode programs
  • 15. /dev Kinda-sorta an equivalent to a mashup of the Device Manager and C:WindowsSystem in Windows Contains a file describing every device, and these files can send data to each device In Linux, everything is a file or a directory
  • 16. /dev 2 hda1, hda2, etc. are partitions on the first physical IDE drive sda1, sda2, etc. are partitions on the first physical SATA drive /dev/cdrom is the optical drive /dev/fd0 is the floppy drive, if you have one /dev/dsp is the speaker device
  • 17. /etc Perhaps the most important to understand No binaries can be here, per the standard This is just for configuration files Examples include /etc/inittab, /etc/fstab , /etc/passwd , /etc/hosts, /etc/x11, and /etc/opt
  • 18. /etc 2 These files are generally text files and can be edited using any text editor:emacs or vi on the command line, or whatever graphical equivalent (e.g. gedit, kate) your desktop offers
  • 19. /etc/inittab Describes what takes place at bootup Includes the runlevel of the system, and which processes should be run at each runlevel Linux has seven runlevels, from 0-6
  • 20. /etc/fstab Automatically mounts file systems across multiple drives or partitions, or even from remote systems This file tells the system what drive to access, and where to mount it in your system
  • 21. /etc/fstab Automatically mounts file systems across multiple drives or partitions, or even from remote systems This file tells the system what drive to access, and where to mount it in your system
  • 22. /etc/hosts This is the famous hosts file, which matches up names with IP addresses This is like level 1 DNS. The system looks here first. This can be used to block sites by putting their URL in here
  • 23. /etc/passwd This is the password file, but it contains more: user name, user password, user ID, group ID, home directory, and shell. It can optionally contain the user's “real name” Each user is on its own line Each user can select the shell they want to use (most use bash these days)
  • 24. /etc/opt/ This is a directory for the configuration files for each system application you install. Each application gets its own subdirectory under /etc/opt/
  • 25. /etc/x11 Configuration directory for x11, which is the display system for graphical interfaces in Linux This can vary with different distros, so again you need to check /etc/x11/xorg.conf is the configuration file that lets you specify the resolutions your monitor and graphics card can display, for instance
  • 26. /home This is where the home directories for all of the “ordinary” users are located. The exception is root, which has its own home directory, /root/ Each user gets a directory with their user name: e.g. /home/devmix This can contain configuration files for applications that are user-specific
  • 27. /home Partition? Your home directory is where you would place all of your documents, videos, MP3s, etc. It can get fairly large It is also the stuff you want to back up, and you don't want to lose Putting it on its own partition, or even its own physical drive, is not a bad idea
  • 28. Reinstalling If you have a separate /home partition, you can reinstall (or do a clean upgrade) and still keep not only your data, but many of your file configurations
  • 29. /lib This is the location for shared library files that are used by system programs Shared library files are equivalent to Windows' “*.dll” files The files here are intended to be libraries for programs in /bin and /sbin, i.e. needed to boot the system and run the commands in the root file system
  • 30. /lib 2 Also in this directory are kernel modules Other library locations for other programs include /usr/lib and /usr/local/lib
  • 31. /media, /mnt Either directory can be a place to mount removable media (e.g. CD, USB drive, Floppy disk) /mnt is the older way, and is still used for temporarily-mounted file systems Most current distro versions will mount these devices automatically
  • 32. /opt Intended as a place for “optional” software, i.e. add-on packages that are not part of the default installation
  • 33. /proc Have we mentioned that everything in Linux is a file or a directory? Any time a process is created in Linux, a corresponding file goes in here Gosh, what would happen if you deleted a file here?
  • 34. /root Home directory for the root account Normally, you don't want to be root, and you don't want to go here
  • 35. /sbin Place for System binaries One of three such directories – /sbin – /usr/sbin – /usr/local/sbin All three hold utilities used for system administration, and are intended for the root user like for booting, restoring, recovering, and/or repairing the system
  • 36. /tmp Guess what this one is? Yes, temporary files are placed here Assume that anything in this directory will be deleted whenever the system is booted If you want to have your own temporary directory and not lose files at reboot, create one in your home directory, i.e. /home/username/temp
  • 37. /usr Lots of stuff in here Back in the mists of prehistory, these were the user directories, equivalent to what are now /home directories Now /usr is for shareable data Not intended for software packages, in general
  • 38. /usr/bin Contains executable files for many Linux commands These are commands that are not part of the core Linux operating system They would go in /bin Examples of commands in here: perl, python
  • 39. /usr/include General use include files, including header files, for C and C++ programming languages
  • 40. /usr/lib Contains libraries for the C and C++ programming languages Object files, libraries, and internal files not intended to be executed directly by users or shell scripts
  • 41. /usr/local For use by System Administrator when installing software locally Must not be over-written when system software is updated Generally has same subdirectories as /usr
  • 42. /usr/sbin Non-essential standard system binaries, i.e. utilities Essential utilities go in /sbin
  • 43. /usr/share/man Primary location for man pages for the system
  • 44. /usr/src Source code is placed here, for reference purposes only This includes the source code for the Linux kernel
  • 45. /var This is for files that are expected to be updated and changed This includes: – mail directories – print spool – logs – web sites
  • 46. /var 2 Because these can be written to constantly, they can grow over time On a server, you may want to put /var on its own partition to limit the growth This can also prevent the /var directory from bringing down the server by using up all of the drive space.
  • 47. /var/lock Contains lock files These files prevent two users (or two programs) from trying to access the same data at the same time You may need to delete a lock file from time to time
  • 48. /var/log Contains the log files generated by programs