File system

Linux® maps the data of physical storage media (such as hard disks or SSDs) into a virtual file system. This means that all files and directories are organized in a single hierarchical tree structure that begins in the root directory /.

This section shows you how the Linux® directory structure is organized and how to navigate it. You will learn how absolute and relative file paths work. You will also learn how file ownership and permissions are organized and how you can display and adjust them. Finally, we show you how to create, open, edit and save files using the command line.

Directory structure of a Beckhoff RT Linux® system.

Directory

Purpose

Description

/ (Root)

Root of the file system

Starting point of the entire file system. All other directories are arranged hierarchically below this directory.

/bin

Essential user programs

Contains essential executable programs that are available to all users, such as basic shell commands (e.g. ls, cp). These programs are required even if only the base system is running.

/boot

Files for system startup

Contains files that are necessary for the boot process of the system, such as the Linux® kernel, the boot loader (e.g. GRUB) and initial RAM disk files.

/dev

Device files

Contains special device files that represent interfaces to physical and virtual devices, e.g. hard disks, USB devices and terminals. These files enable access to hardware via the Linux® kernel.

/etc

System-wide configuration files

Contains the central configuration files of the system, which control the functioning of the system and its services. This includes network, user and daemon configurations.

/home

User home directories

Contains the users' personal directories in which their own files and user-specific settings are saved. Each user account has its own subdirectory, e.g. /home/user.

/lib

Essential system libraries

Contains shared libraries that are required by the basic programs in /bin and /sbin. These libraries are essential for the operation of the system.

/media

Automatic integration of removable media

Standard directory for automatically mounting removable media such as USB drives, CD-ROM and other external storage media.

/mnt

Temporary manual mount points

Is used to temporarily mount file systems or drives manually, e.g. for maintenance or diagnostic purposes.

/opt

Optional or additional software

Includes optional, additional or manually installed software packages by the administrator that are not part of the standard Debian installation.

/proc

Virtual kernel and process file system

Virtual file system that provides information about the kernel, running processes and the system status. Used for system monitoring and diagnostics, among other things.

/root

Home directory of the administrator

Personal home directory of the system administrator root. It is located directly below / in order to be accessible even when system availability is limited.

/run

Volatile runtime data (systemd)

Volatile runtime directory (tmpfs) that is created at system startup. Contains current system and service information such as PID files, sockets and status data. Used intensively by systemd.

/sbin

System administration programs

Contains system administration programs that are mainly used by root or users with corresponding rights, e.g. reboot, fsck.

/srv

Data for services provided

Contains data for services provided by the system, e.g. content from web, FTP or other network services.

/sys

Virtual device and kernel file system

Virtual file system (sysfs) that provides information about devices, drivers and kernel structures. Used by systemd, udev and management tools.

/tmp

Temporary files

Contains temporary files that are created by programs or the system. These files are not permanent and are usually deleted when the system is restarted.

/usr

User programs and system-wide resources

Contains the majority of user programs, libraries and system-wide resources. Typical subdirectories are /usr/bin, /usr/lib and /usr/share.

/usr/local

Locally installed software

Contains software installed locally by the administrator that is not managed by the Debian package management. Used for clean separation of distribution and local customizations.

/var

Variable runtime data (logs, cache, spools)

Contains variable data that changes during system operation, such as log files, cache data, spool files and status information.