Presentation is loading. Please wait.

Presentation is loading. Please wait.

File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.

Similar presentations

Presentation on theme: "File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are."— Presentation transcript:

1 File System and Directory Structure in Linux

2 What is File System In a computer, a file system is the way in which files are named and where they are placed logically for storage and retrieval. Sometimes the term refers to the part of an operating system or an added-on program that supports a file system. Examples of such add-on file systems include the Network File System (NFS).

3 logical file structure physical representation on disk

4 File System File systems specify conventions for naming files. These conventions include the maximum number of characters in a name, which characters can be used, and, in some systems, how long the file name suffix can be. A file system also includes a format for specifying the path to a file through the structure of directories.

5 Linux File System Ext2: This is like UNIX file system. Ext3: It is ext2 filesystem with enhancement. Isofs (iso9660): Used by CDROM file system. Sysfs: It is a ram-based filesystem initially based on ramfs. It is use to exporting kernel objects so that end user can use it easily. Procfs: The proc file system acts as an interface to internal data structures in the kernel For example you can find out cpuinfo with following command:

6 Inside File System User Data Meta Data

7 Linux Directory Structure The Directory Structure in Unix & Linux are a unified Directory Structure where in all the directories are unified under the "/" Root file system. Irrespective of where the File System is physically mounted all the directories are arranged hierarchically under the Root file system.


9 1. / – Root Every single file and directory starts from the root directory. Only root user has write privilege under this directory.

10 2. /bin – User Binaries Contains binary executables. Common linux commands you need to use in single-user modes are located under this directory. For example: ps, ls, ping, grep, cp.

11 3. /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. For example: iptables, reboot, fdisk, ifconfig,

12 4. /etc – Configuration Files Contains configuration files required by all programs. This also contains startup and shutdown shell scripts used to start/stop individual programs. For example: /etc/resolv.conf, /etc/logrotate.conf

13 5. /dev – Device Files Contains device files. These include terminal devices, usb, or any device attached to the system. For example: /dev/tty1, /dev/usbmon0

14 6. /proc – Process Information Contains information about system process. This filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid. This is a virtual filesystem with text information about system resources. For example: /proc/uptime

15 7. /var – Variable Files var stands for variable files. Content 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); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);

16 8. /tmp – Temporary Files Directory that contains temporary files created by system and users. Files under this directory are deleted when system is rebooted.

17 9. /usr – User Programs Home directories for all users to store their personal files. For example: /home/john

18 11. /boot – Boot Loader Files Contains boot loader related files. Grub files are located under /boot For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic

19 12. /lib – System Libraries Contains library files that supports the binaries located under /bin and /sbin Library filenames are either ld* or lib*.so.* For example:,

20 13. /opt – Optional add-on Applications opt stands for optional. Contains add-on applications from individual vendors. add-on applications should be installed under either /opt/ or /opt/ sub-directory.

21 14. /mnt – Mount Directory Temporary mount directory where sysadmins can mount filesystems.

22 Inode The inode (index node) is a fundamental concept in the Linux and UNIX file system. Each object in the file system is represented by an inode.

23 File Information File type (executable, block special etc) => Permissions (read, write etc) => Owner => Group => File Size => File access, change and modification time (remember UNIX or Linux never stores file creation time, this is favorite question asked in UNIX/Linux sys admin job interview) => File deletion time => => Access Control List (ACLs)

24 Inode All the above information stored in an inode. In short the inode identifies the file and its attributes (as above). Each inode is identified by a unique inode number within the file system. Inode is also know as index number.

Download ppt "File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are."

Similar presentations

Ads by Google