Last Updated: September 26, 2019
·
2.373K
· bt3gl

The Linux File System (Fedora)

The Linux filesystem architecture is generally divided into the following folders:

/bin

Directory containing executable binaries, essential commands used in single-user mode, and essential commands required by all system users..

/sbin

Commands that are not essential for the system in single-user mode.

/user/sbin has commands for less essential system administration programs. In more modern Linux, this is actually linked together to /sbin.

/dev

Contains device nodes: a type of pseudo-file used by most hardware and software devices, except for network devices.

This directory is empty on the disk partition when it is not mounted.

It contains entries which are created by the udev system, which creates and manages device nodes on Linux, creating them dynamically when devices are found.

/var

It contains files that are expected to change in size and content as the system is running.

Var stands for variable.

Examples:

  • system log files: /var/log
  • packages and database files: /var/lib
  • print queues: /var/spool
  • temp files: /var/tmp
  • networks services such as /var/ftp and /var/www

/etc

It contains the system configuration files.

It contains no binary programs, but it might have some executable scripts.

For instance, the file resolv.conf tells the system where to go on the network to obtain host name to IP address mappings (DNS).

/boot

Contains the few essential files needed to boot the system.
For every alternative kernel installed on the system, there are four files:

  • vmlinuz: the compressed Linux kernel, required for booting.

  • initramfs or initrd: the initial ram filesystem, required for booting.

  • config: the kernel configuration file, used for debugging.

  • system.map: kernel symbol table.

GRUB files can be found here too.

/lib

Contain libraries (common code shared by applications and needed for them to run) for essential programs in /bin and /sbin.

This library filenames either start with ld or lib.

Most of these are what are known as dynamically loaded libraries (also known as shared libaries).

/media

(outdated, to edit) directory where removable media were mounted.

/opt

Optional directory for application software packages.

/tmp

Temporary files.
Erased in a reboot.

/usr

Multi-user applications, utilities and data.
Subdirectories:

  • /usr/include: header files used to compile applications.

  • /usr/lib: libraries for programs in /usr/(s)bin

  • /usr/sbin: non-essential system binaries, such as system daemons

  • /usr/share: shaped data used by applications, generally architecture-independent.

  • /usr/src: source code, usually for the Linux kernel.

  • /usr/local: data and programs specific to the local machine.

  • /usr/bin: primary directory of executable commands of the system/

A really nice introduction to many fileystems.

7 Responses
Add your response

Awesome! This is really helpful for someone who decided to use only linux this year, thanks!

over 1 year ago ·

Thanks! Boa sorte, Linux is awesome! Meu abraco `a bela Santa Catarina!

over 1 year ago ·

I had the same pattern, years ago, until the moment I convinced myself I didn't need a windows fix anymore (and that gimp wasn't thaaat bad) =p

over 1 year ago ·

I had the same pattern, years ago, until the moment I convinced myself I didn't need a windows fix anymore (and that gimp wasn't thaaat bad) =p

over 1 year ago ·

I think /media is out of date nowadays. This should be updated to cover /run which is where a lot of state data goes, including /run/user/$UID/media for user-accessible media like USB sticks, CDs, portable external hard disks, and so on.

over 1 year ago ·

Yeah, you are right, going to add an edit, thanks!

over 1 year ago ·

Awesome !
I'm using Fedora Linux and it's very great system !
Thanks

over 1 year ago ·