The Linux File System Hierarchy

To be able to manage a Linux computer, you need to be familiar with the default directories.

The layout of the Linux file system hierarchy is defined in the Filesystem Hierarchy Standard (FHS).

File System Hierarchy Overview

Linux Filesystem Hierarchy

/This is known as the root directory, which is the start of the file system tree. Everything in Linux appears under /, even other partitions.
/binThis directory contains important programs and utilities such as the BASH shell. This directory is essential during boot.
/botaContains all the files and directories to boot the Linux kernel. Els arxius de nucli i el gestor d'arrencada GRUB de Linux s'emmagatzemen aquí.
/devYou can find the device files here, such as the ones to access the physical devices. This directory is essential during boot.
/etc.Contains configuration files that are used by programs and services that are used on your server. These configuration files are used system wide. This directory is essential during boot.
/casaThis is the home directory for the user. If the user is tim then the home directory would be /home/bob. The home directory contains the user's data files and user specific configuration files. The user only has write access to their own home directory. Only elevated permissions can access all users home directory.
/lib, /lib64Shared libraries that are used by programs in /boot, /bin and /sbin
/media, /mnt/media contains directories where removable media devices such as CDs are mounted. /mnt is where temporary files systems are mounted, per exemple, 1 finestres partition could be mounted at /mnt/windows.
/optOptional directory for programs to store files, if they don't use the FHS standard. A program could store its files in /opt/application
/procThis directory is used by the proc file system. Provides access to kernel information.
/rootHome directory for the root user. This is different to /.
/correrContains process and user specific information that has been created since the last boot. Applications can store information such as sockets and process IDs.
/sbinSimilar to /bin, but for system administration commands that are run by the root user.
/srvDirectory that may be used for data that is used by services like NFS, FTP & HTTP.
/sysUsed to interface to different hardware devices that is managed by the Linux kernel and associated processes
/usrContains directories with program files, libraries for these program files and documentation. These files are used by user application.
/eraContains files that may change in size. Eg. log files (/var/log), mail boxes and spool files.


Mounting in Linux

Linux allows mounting devices under the / root. This allows to organise the Linux file-system in a flexible way such as distributing the file system among different devices.

/bota : Often mounted to a separate hard disk as this directory contains important information for booting the computer.

/era : Often is on a separate dedicated hard disk as the size of the directory can grow rapidly. Using a separate storage also ensures the space of the computer stays intact.

/casa : Often stored on a dedicated device or hard disk for security reasons. You can then mount the device to the Linux file-system in secure way. If the OS needs to be reinstalled user specific files stay intact and can be easily remounted.

/usr : Contains operating system files that users don’t need write access to. Putting this on a dedicated device ensures that it can be mounted read-only.

The mount command is used to show the overview of the mounted devices. The information used by the mount command is read from the /proc/mounts directory. df -Th command shows available disk space on current mounts. -h summarizes the output and -T shows the filesystem type used on the different mounts. findmnt shows mounts and the relation that exists between the different mounts.


Deixa un comentari