O'Reilly logo

Linux Cookbook by Carla Schroder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Managing Files and Partitions

Introduction

Understanding filesystem fundamentals is key to understanding how Linux works. Everything is a file—data files, partitions, pipes, sockets, and hardware devices. Directories are simply files that list other files.

The Filesystem Hierarchy Standard (FHS) was developed as a voluntary standard. Most Linuxes follow it. These are the required elements of the Linux root filesystem:

/

Root directory, even though it is always represented at the top

/bin

Essential system commands

/boot

Static boot loader files

/dev

Device files

/etc

Host-specific system configuration files

/lib

Shared libraries needed to run the local system

/mnt

Temporary mount points

/opt

Add-on software packages (not used much in Linux)

/proc

Live kernel snapshot and configuration

/sbin

System administration commands

/tmp

Temporary files—a well-behaved system flushes them between startups

/usr

Shareable, read-only data and binaries

/var

Variably sized files, such as mail spools and logs

These are considered optional because they can be located anywhere on a network, whereas the required directories must be present to run the machine:

/home

User’s personal files

/root

Superuser’s personal files

The FHS goes into great detail on each directory, for those who are interested. Here are some things for the Linux user to keep in mind:

  • /tmp and /var can go in their own individual partitions, as a security measure. If something goes awry and causes them to fill up uncontrollably, they will be isolated from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required