Linux Filesystem Hierarchy The Linux Documentation Project
The Root Directory   <ul><li>/bin </li></ul><ul><li>/boot </li></ul><ul><li>/dev </li></ul><ul><li>/etc </li></ul><ul><li>...
1. /bin  <ul><li>Contains several useful commands that are of use to both the system administrator as well as non-privileg...
1. /bin …(cont) <ul><li>cat </li></ul><ul><li>chgrp </li></ul><ul><li>chmod </li></ul><ul><li>chown </li></ul><ul><li>cp <...
1. /bin  detail <ul><li>cat </li></ul><ul><li>chgrp </li></ul><ul><li>chmod </li></ul><ul><li>chown </li></ul><ul><li>cp <...
1. /bin  detail (cont) <ul><li>hostname </li></ul><ul><li>kill </li></ul><ul><li>ln </li></ul><ul><li>login </li></ul><ul>...
1. /bin  detail (cont) <ul><li>pwd </li></ul><ul><li>rm </li></ul><ul><li>rmdir </li></ul><ul><li>sed </li></ul><ul><li>sh...
2. /boot  <ul><li>Contains everything required for the boot process except for configuration files not needed at boot time...
2. /boot … detail <ul><li>/boot/boot.0300  </li></ul><ul><li>/boot/boot.b </li></ul><ul><li>/boot/chain.b </li></ul><ul><l...
3. /dev  <ul><li>Usualy is the location of device files </li></ul><ul><li>A device and a file both can be read from and wr...
3. /dev … detail <ul><li>/dev/ttyS0 </li></ul><ul><li>/dev/psaux  </li></ul><ul><li>/dev/lp0  </li></ul><ul><li>/dev/dsp  ...
4. /etc  <ul><li>Contains all system related configuration files   </li></ul><ul><li>Local file used to control the operat...
4. /etc … detail <ul><li>/etc/X11/ : contains all the configuration files for the X Window System  </li></ul><ul><li>/etc/...
4. /etc … detail <ul><li>/etc/hosts : This file is used to define a system name and domain combination with a specific IP ...
5. /home  <ul><li>The user home directories  </li></ul><ul><li>Accessible only to its owner and the system administrator  ...
6. /initrd  <ul><li>Provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as th...
7. /lib <ul><li>Contains  kernel modules and those shared library images (the C programming code library) needed to boot t...
7. /lib … detail <ul><li>/lib/'machine-architecture‘ :  Contains platform/architecture dependent libraries. </li></ul><ul>...
8. /lost+found  <ul><li>Contains the files which were recovered after an unexpected event, such as a proper shutdown. </li...
9. /media  <ul><li>Contains subdirectories which are used as mount points for removeable media such as floppy disks, cdrom...
10. /mnt <ul><li>This is a generic mount point under mounted (mount is to make a filesystem available to the system) the f...
11. /opt  <ul><li>This directory is reserved for all the software and add-on packages that are not part of the default ins...
12. /proc  <ul><li>Virtual filesystem, runtime system information (e.g. system memory, devices mounted, hardware configura...
13. /root  <ul><li>The home directory of the System Administrator, 'root'  </li></ul><ul><li>Why not in '/home'? Because '...
14. /sbin <ul><li>Like /bin bet less important </li></ul><ul><li>/sbin should contain only binaries essential for booting,...
14. /sbin … detail <ul><li>shutdown  </li></ul><ul><li>Fastboot </li></ul><ul><li>Fasthalt </li></ul><ul><li>fdisk  </li><...
14. /sbin … detail <ul><li>init  </li></ul><ul><li>mkfs  </li></ul><ul><li>mkfs.*  </li></ul><ul><li>mkswap  </li></ul><ul...
15. /usr <ul><li>The largest share of data on a system  </li></ul><ul><li>the most important directories in the system as ...
16. /var <ul><li>Contains variable data, files and directories the system must be able to write to during operation, like ...
Upcoming SlideShare
Loading in …5
×

Linux filesystemhierarchy

1,020 views

Published on

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
1,020
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
0
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Linux filesystemhierarchy

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

×