SlideShare a Scribd company logo
Linux Filesystem Hierarchy The Linux Documentation Project
The Root Directory   /bin /boot /dev /etc /home  /initrd /lib /lost+found  /media /mnt /opt /proc /root /sbin /usr /srv /tmp /var
1. /bin  Contains several useful commands that are of use to both the system administrator as well as non-privileged users.  Usually contains the shells like bash, csh, etc.... and commonly used commands like cp, mv, rm, cat, ls.  Also contains programs which boot scripts may depend on  There are no (real) subdirectories in /bin
1. /bin …(cont) cat chgrp chmod chown cp date dd df dmesg echo false rm rmdir sed sh stty su sync true umount uname hostname kill ln login ls mkdir mknod more mount mv ps pwd
1. /bin  detail cat chgrp chmod chown cp date dd df dmesg echo false Utility to concatenate files to standard output Utility to change file group ownership Utility to change file access permissions Utility to change file owner and group Utility to copy files and directories Utility to print or set the system data and time Utility to convert and copy a file Utility to report filesystem disk space usage Utility to print or control the kernel message buffer Utility to display a line of text Utility to do nothing, unsuccessfully
1. /bin  detail (cont) hostname kill ln login ls mkdir mknod more mount mv ps Utility to show or set the system's host name Utility to send signals to processes Utility to make links between files Utility to begin a session on the system Utility to list directory contents Utility to make directories Utility to make block or character special files Utility to page through text Utility to mount a filesystem Utility to move/rename files Utility to report process status
1. /bin  detail (cont) pwd rm rmdir sed sh stty su sync true umount uname Utility to print name of current working directory Utility to remove files or directories Utility to remove empty directories The `sed' stream editor The Bourne command shell Utility to change and print terminal line settings Utility to change user ID Utility to flush filesystem buffers Utility to do nothing, successfully Utility to unmount file systems Utility to print system information
2. /boot  Contains everything required for the boot process except for configuration files not needed at boot time and the map installer  Stores data that is used before the kernel begins executing user-mode programs  May include the system kernel (under symbolically linked)
2. /boot … detail /boot/boot.0300  /boot/boot.b /boot/chain.b /boot/config-kernel-version  /boot/map /boot/vmlinuz /boot/vmlinuz-kernel-version … Backup master boot record. The basic boot sector Used to boot non-Linux operating systems Installed kernel configuration. A config line such as: CONFIG_FONT_8x8=y The location of the kernel Normally the kernel or symbolic link to the kernel
3. /dev  Usualy is the location of device files A device and a file both can be read from and written to. So config a device is same with edit a file. EX: sending data to /dev/ttyS0 that means you are sending data to  a communication device, such as a modem. 'block devices' are devices that store or hold data 'character devices' can be thought of as devices that transmit or transfer data
3. /dev … detail /dev/ttyS0 /dev/psaux  /dev/lp0  /dev/dsp  /dev/usb  /dev/sda  /dev/scd  /dev/cdrom  /dev/fd0  /dev/had Device connected to Com1 (Modem, mouse,..)  PS/2 mouse connection  First parallel port  Sound card ( d igital  s ignal  p rocessor) USB device nodes.  First SCSI device  First SCSI CD-ROM device CD-ROM drive  floppy drive The partition on primary hdd
4. /etc  Contains all system related configuration files   Local file used to control the operation of a program Those files must be static and cannot be an executable binary
4. /etc … detail /etc/X11/ : contains all the configuration files for the X Window System  /etc/X11/XF86Config, /etc/X11/XF86Config-4 : 'X' configuration file /etc/ftpchroot : List of ftp users that need to be chrooted /etc/ftpaccess : Determines who might get ftp-access to your machine. /etc/gateways : Lists gateways for 'routed' /etc/group, /etc/passwd. lists the configured user groups and who belongs to them. /etc/hostname : Contains the hostname of your machine  /etc/host.conf : Determines the search order for look-ups
4. /etc … detail /etc/hosts : This file is used to define a system name and domain combination with a specific IP address 127.0.0.1 localhost ::1 localhost  ip6-localhost ip6-loopback  fe00::0 ip6-localnet  ff00::0 ip6-mcastprefix  ff02::1 ip6-allnodes  ff02::2 ip6-allrouters  ff02::3 ip6-allhosts  192.168.0.99 debian.localdomain.com debian  192.168.0.1 ws001
5. /home  The user home directories  Accessible only to its owner and the system administrator  Contains the user’s personal configuration files  Quite large to be used as User’s Documents Space
6. /initrd  Provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as the root file system and programs can be run from it. Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted.  Initrd is mainly designed to allow system startup to occur in two phases, where the kernel comes up with a minimum set of compiled-in drivers, and where additional modules are loaded from initrd.
7. /lib 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, ie. by binaries in /bin and /sbin  Windows equivalent to a shared library would be a DLL (dynamically linked library) file
7. /lib … detail /lib/'machine-architecture‘ :  Contains platform/architecture dependent libraries. /lib/iptables : iptables shared library files. /lib/kbd : Contains various keymaps. /lib/modules/'kernel-version‘ : The home of all the kernel modules. The organisation of files here is reasonably clear so no requires no elaboration.  /lib/modules/'kernel-version'/isapnpmap.dep : has details on ISA based cards, the modules that they require and various other attributes.  /lib/modules/'kernel-version'/modules.dep : lists all modules dependencies. This file can be updated using the depmod command.  /lib/modules/'kernel-version'/pcimap : is the PCI equivalent of the /lib/modules/'kernel-version'/isapnpmap.dep file.  /lib/modules/'kernel-version'/usbmap : is the USB equivalent of the /lib/modules/'kernel-version'/isapnpmap.dep file. /lib/oss : All OSS (Open Sound System) files are installed here by default.  /lib/security : PAM library files.
8. /lost+found  Contains the files which were recovered after an unexpected event, such as a proper shutdown. Try to move each file back to its original location
9. /media  Contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks
10. /mnt This is a generic mount point under mounted (mount is to make a filesystem available to the system) the filesystems or devices. When a filesystem no longer needs to be mounted, it can be unmounted with umount mount /dev/hda2 /home  umount /dev/hda2
11. /opt  This directory is reserved for all the software and add-on packages that are not part of the default installation  /opt/'package'    C:\Windows\Progam Files\"Program Name"
12. /proc  Virtual filesystem, runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).  The most of them have a file size of 0  To view, use “cat”. Use “vi” to edit.
13. /root  The home directory of the System Administrator, 'root'  Why not in '/home'? Because '/home' is often located on a different partition or even on another system and would thus be inaccessible to 'root' when - for some reason - only '/' is mounted.
14. /sbin Like /bin bet less important /sbin should contain only binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin.
14. /sbin … detail shutdown  Fastboot Fasthalt fdisk  fsck  fsck.*  getty  halt  ifconfig  Command to bring the system down. Reboot the system without checking the disks (optional) Stop the system without checking the disks (optional) Partition table manipulator (optional) File system check and repair utility (optional) File system check and repair utility for a specific filesystem (optional) The getty program (optional) Command to stop the system (optional) Configure a network interface (optional)
14. /sbin … detail init  mkfs  mkfs.*  mkswap  reboot  route  swapon  swapoff  update  Initial process (optional) Command to build a filesystem (optional) Command to build a specific filesystem (optional) Command to set up a swap area (optional) Command to reboot the system (optional) IP routing table utility (optional) Enable paging and swapping (optional) Disable paging and swapping (optional) Daemon to periodically flush filesystem buffers (optional)
15. /usr The largest share of data on a system  the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc.... X and its supporting libraries, and User programs like telnet, ftp, etc.... as well, can be found here.
16. /var Contains variable data, files and directories the system must be able to write to during operation, like system logging files, mail and printer spool directories, and transient and temporary files

More Related Content

PPTX
11 linux filesystem copy
PDF
Linux directory structure by jitu mistry
PPT
101 1.2 boot the system
PPT
Unix File System
ODP
4. linux file systems
PDF
Installing Linux: Partitioning and File System Considerations
PPTX
How to design a file system
PPT
Linux lecture5
11 linux filesystem copy
Linux directory structure by jitu mistry
101 1.2 boot the system
Unix File System
4. linux file systems
Installing Linux: Partitioning and File System Considerations
How to design a file system
Linux lecture5

What's hot (20)

PPT
101 4.3 control mounting and unmounting of filesystems
PPTX
Linux standard file system
PPTX
Ext filesystem4
PPT
Lpi lição 01 exam 102 objectives
PDF
File Systems
PPT
Linux file system
PDF
Part 03 File System Implementation in Linux
PPTX
Unix Administration
PPT
PDF
Lecture 5 Kernel Development
PPT
101 1.1 hardware settings
PPTX
Fuse- Filesystem in User space
PPT
1.2 boot the system v2
PPT
101 2.2 install boot manager
PPT
101 2.1 design hard disk layout v2
PDF
Lesson 2 Understanding Linux File System
PPT
Unix fundamentals
PDF
Writing flexible filesystems in FUSE-Python
PPTX
Files and directories in Linux 6
101 4.3 control mounting and unmounting of filesystems
Linux standard file system
Ext filesystem4
Lpi lição 01 exam 102 objectives
File Systems
Linux file system
Part 03 File System Implementation in Linux
Unix Administration
Lecture 5 Kernel Development
101 1.1 hardware settings
Fuse- Filesystem in User space
1.2 boot the system v2
101 2.2 install boot manager
101 2.1 design hard disk layout v2
Lesson 2 Understanding Linux File System
Unix fundamentals
Writing flexible filesystems in FUSE-Python
Files and directories in Linux 6
Ad

Similar to Linux filesystemhierarchy (20)

PDF
File system discovery
PDF
File system discovery
PDF
Linux Directory Structure
PDF
Lecture1 Introduction
PPT
Linux training
ODP
File system hiearchy
PPTX
Linux fundamentals
PPTX
Linux Presentation
PPT
LinuxTraining_26_Sept_2021.ppt
PPTX
Week6 filesystem
PPT
Tutorial 2
PPTX
Linux file system
PDF
linuxfilesystem-180727181106 (1).pdf
PDF
Linux file
PPT
Basic linux architecture
PPT
Linux shell scripting
PPT
3. introduction of centos
PPTX
Linux week 2
PPTX
Linux basics
PPTX
Linux booting process - Linux System Administration
File system discovery
File system discovery
Linux Directory Structure
Lecture1 Introduction
Linux training
File system hiearchy
Linux fundamentals
Linux Presentation
LinuxTraining_26_Sept_2021.ppt
Week6 filesystem
Tutorial 2
Linux file system
linuxfilesystem-180727181106 (1).pdf
Linux file
Basic linux architecture
Linux shell scripting
3. introduction of centos
Linux week 2
Linux basics
Linux booting process - Linux System Administration
Ad

More from Dr. C.V. Suresh Babu (20)

PPTX
Data analytics with R
PPTX
Association rules
PPTX
PPTX
Classification
PPTX
Blue property assumptions.
PPTX
Introduction to regression
PPTX
Expert systems
PPTX
Dempster shafer theory
PPTX
Bayes network
PPTX
Bayes' theorem
PPTX
Knowledge based agents
PPTX
Rule based system
PPTX
Formal Logic in AI
PPTX
Production based system
PPTX
Game playing in AI
PPTX
Diagnosis test of diabetics and hypertension by AI
PPTX
A study on “impact of artificial intelligence in covid19 diagnosis”
PDF
A study on “impact of artificial intelligence in covid19 diagnosis”
Data analytics with R
Association rules
Classification
Blue property assumptions.
Introduction to regression
Expert systems
Dempster shafer theory
Bayes network
Bayes' theorem
Knowledge based agents
Rule based system
Formal Logic in AI
Production based system
Game playing in AI
Diagnosis test of diabetics and hypertension by AI
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Machine Learning_overview_presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
1. Introduction to Computer Programming.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine Learning_overview_presentation.pptx
cuic standard and advanced reporting.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Group 1 Presentation -Planning and Decision Making .pptx
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
A comparative analysis of optical character recognition models for extracting...
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Linux filesystemhierarchy

  • 1. Linux Filesystem Hierarchy The Linux Documentation Project
  • 2. The Root Directory /bin /boot /dev /etc /home /initrd /lib /lost+found /media /mnt /opt /proc /root /sbin /usr /srv /tmp /var
  • 3. 1. /bin Contains several useful commands that are of use to both the system administrator as well as non-privileged users. Usually contains the shells like bash, csh, etc.... and commonly used commands like cp, mv, rm, cat, ls. Also contains programs which boot scripts may depend on There are no (real) subdirectories in /bin
  • 4. 1. /bin …(cont) cat chgrp chmod chown cp date dd df dmesg echo false rm rmdir sed sh stty su sync true umount uname hostname kill ln login ls mkdir mknod more mount mv ps pwd
  • 5. 1. /bin detail cat chgrp chmod chown cp date dd df dmesg echo false Utility to concatenate files to standard output Utility to change file group ownership Utility to change file access permissions Utility to change file owner and group Utility to copy files and directories Utility to print or set the system data and time Utility to convert and copy a file Utility to report filesystem disk space usage Utility to print or control the kernel message buffer Utility to display a line of text Utility to do nothing, unsuccessfully
  • 6. 1. /bin detail (cont) hostname kill ln login ls mkdir mknod more mount mv ps Utility to show or set the system's host name Utility to send signals to processes Utility to make links between files Utility to begin a session on the system Utility to list directory contents Utility to make directories Utility to make block or character special files Utility to page through text Utility to mount a filesystem Utility to move/rename files Utility to report process status
  • 7. 1. /bin detail (cont) pwd rm rmdir sed sh stty su sync true umount uname Utility to print name of current working directory Utility to remove files or directories Utility to remove empty directories The `sed' stream editor The Bourne command shell Utility to change and print terminal line settings Utility to change user ID Utility to flush filesystem buffers Utility to do nothing, successfully Utility to unmount file systems Utility to print system information
  • 8. 2. /boot Contains everything required for the boot process except for configuration files not needed at boot time and the map installer Stores data that is used before the kernel begins executing user-mode programs May include the system kernel (under symbolically linked)
  • 9. 2. /boot … detail /boot/boot.0300 /boot/boot.b /boot/chain.b /boot/config-kernel-version /boot/map /boot/vmlinuz /boot/vmlinuz-kernel-version … Backup master boot record. The basic boot sector Used to boot non-Linux operating systems Installed kernel configuration. A config line such as: CONFIG_FONT_8x8=y The location of the kernel Normally the kernel or symbolic link to the kernel
  • 10. 3. /dev Usualy is the location of device files A device and a file both can be read from and written to. So config a device is same with edit a file. EX: sending data to /dev/ttyS0 that means you are sending data to a communication device, such as a modem. 'block devices' are devices that store or hold data 'character devices' can be thought of as devices that transmit or transfer data
  • 11. 3. /dev … detail /dev/ttyS0 /dev/psaux /dev/lp0 /dev/dsp /dev/usb /dev/sda /dev/scd /dev/cdrom /dev/fd0 /dev/had Device connected to Com1 (Modem, mouse,..) PS/2 mouse connection First parallel port Sound card ( d igital s ignal p rocessor) USB device nodes. First SCSI device First SCSI CD-ROM device CD-ROM drive floppy drive The partition on primary hdd
  • 12. 4. /etc Contains all system related configuration files Local file used to control the operation of a program Those files must be static and cannot be an executable binary
  • 13. 4. /etc … detail /etc/X11/ : contains all the configuration files for the X Window System /etc/X11/XF86Config, /etc/X11/XF86Config-4 : 'X' configuration file /etc/ftpchroot : List of ftp users that need to be chrooted /etc/ftpaccess : Determines who might get ftp-access to your machine. /etc/gateways : Lists gateways for 'routed' /etc/group, /etc/passwd. lists the configured user groups and who belongs to them. /etc/hostname : Contains the hostname of your machine /etc/host.conf : Determines the search order for look-ups
  • 14. 4. /etc … detail /etc/hosts : This file is used to define a system name and domain combination with a specific IP address 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts 192.168.0.99 debian.localdomain.com debian 192.168.0.1 ws001
  • 15. 5. /home The user home directories Accessible only to its owner and the system administrator Contains the user’s personal configuration files Quite large to be used as User’s Documents Space
  • 16. 6. /initrd Provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as the root file system and programs can be run from it. Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted. Initrd is mainly designed to allow system startup to occur in two phases, where the kernel comes up with a minimum set of compiled-in drivers, and where additional modules are loaded from initrd.
  • 17. 7. /lib 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, ie. by binaries in /bin and /sbin Windows equivalent to a shared library would be a DLL (dynamically linked library) file
  • 18. 7. /lib … detail /lib/'machine-architecture‘ : Contains platform/architecture dependent libraries. /lib/iptables : iptables shared library files. /lib/kbd : Contains various keymaps. /lib/modules/'kernel-version‘ : The home of all the kernel modules. The organisation of files here is reasonably clear so no requires no elaboration. /lib/modules/'kernel-version'/isapnpmap.dep : has details on ISA based cards, the modules that they require and various other attributes. /lib/modules/'kernel-version'/modules.dep : lists all modules dependencies. This file can be updated using the depmod command. /lib/modules/'kernel-version'/pcimap : is the PCI equivalent of the /lib/modules/'kernel-version'/isapnpmap.dep file. /lib/modules/'kernel-version'/usbmap : is the USB equivalent of the /lib/modules/'kernel-version'/isapnpmap.dep file. /lib/oss : All OSS (Open Sound System) files are installed here by default. /lib/security : PAM library files.
  • 19. 8. /lost+found Contains the files which were recovered after an unexpected event, such as a proper shutdown. Try to move each file back to its original location
  • 20. 9. /media Contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks
  • 21. 10. /mnt This is a generic mount point under mounted (mount is to make a filesystem available to the system) the filesystems or devices. When a filesystem no longer needs to be mounted, it can be unmounted with umount mount /dev/hda2 /home umount /dev/hda2
  • 22. 11. /opt This directory is reserved for all the software and add-on packages that are not part of the default installation /opt/'package'  C:\Windows\Progam Files\"Program Name"
  • 23. 12. /proc Virtual filesystem, runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). The most of them have a file size of 0 To view, use “cat”. Use “vi” to edit.
  • 24. 13. /root The home directory of the System Administrator, 'root' Why not in '/home'? Because '/home' is often located on a different partition or even on another system and would thus be inaccessible to 'root' when - for some reason - only '/' is mounted.
  • 25. 14. /sbin Like /bin bet less important /sbin should contain only binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin.
  • 26. 14. /sbin … detail shutdown Fastboot Fasthalt fdisk fsck fsck.* getty halt ifconfig Command to bring the system down. Reboot the system without checking the disks (optional) Stop the system without checking the disks (optional) Partition table manipulator (optional) File system check and repair utility (optional) File system check and repair utility for a specific filesystem (optional) The getty program (optional) Command to stop the system (optional) Configure a network interface (optional)
  • 27. 14. /sbin … detail init mkfs mkfs.* mkswap reboot route swapon swapoff update Initial process (optional) Command to build a filesystem (optional) Command to build a specific filesystem (optional) Command to set up a swap area (optional) Command to reboot the system (optional) IP routing table utility (optional) Enable paging and swapping (optional) Disable paging and swapping (optional) Daemon to periodically flush filesystem buffers (optional)
  • 28. 15. /usr The largest share of data on a system the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc.... X and its supporting libraries, and User programs like telnet, ftp, etc.... as well, can be found here.
  • 29. 16. /var Contains variable data, files and directories the system must be able to write to during operation, like system logging files, mail and printer spool directories, and transient and temporary files