DEV Community

Cover image for Managing Files From the Command Line
Salsa Nabila
Salsa Nabila

Posted on

Managing Files From the Command Line

The File-system Hierarchy
All files on a Linux system are stored on file systems, which are organized into a single inverted tree of directories, known as a file-system hierarchy. This tree is inverted because the root of the tree is said to be at the top of the hierarchy, and the branches of directories and subdirectories stretch below the root.

Image description

The / directory is the root directory at the top of the file-system hierarchy. The / character is also used as a _directory _separator in file names. For example, if etc is a subdirectory of the / directory, you could refer to that directory as /etc. Likewise, if the /etc directory contained a file named issue, you could refer to that file as /etc/issue.

Subdirectories of / are used for standardized purposes to organize files by type and purpose. This makes it easier to find files. For example, in the root directory, the subdirectory /boot is used for storing files needed to boot the system.

Note

The following terms help to describe file-system directory contents:

  • static content remains unchanged until explicitly edited or reconfigured.

  • dynamic or variable content may be modified or appended by active processes.

  • persistent content remains after a reboot, like configuration settings.

  • runtime content is process- or system-specific content that is deleted by a reboot.

The following table lists some of the most important directories on the system by name and purpose.

Image description

Important

In Red Hat Enterprise Linux 7 and later, four older directories in / have identical contents to their counterparts located in /usr:

  • /bin and /usr/bin
  • /sbin and /usr/sbin
  • /lib and /usr/lib
  • /lib64 and /usr/lib64

In earlier versions of Red Hat Enterprise Linux, these were distinct directories containing different sets of files.

In Red Hat Enterprise Linux 7 and later, the directories in / are symbolic links to the matching directories in /usr.

Top comments (0)