Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Linux Directory Structure Explained

Tags: directory

For a Windows user, the Linux file structure can be, and often is, quite confusing. From the start, the beginning of the root system is quite different.

In Windows, the root starts with the physical hard drive location, most often “C:/”. In Linux, however, the root is a logical location marked simply as “/”.

In Windows, we have drives, files, and folders. In Linux, everything is represented as being a file. The file system structure in Linux is defined by a so-called “Filesystem Hierarchy Standard (FHS)”

What follows are the Linux directories and their corresponding uses and functions.

  • “/” – Root Directory – Everything starts from the root directory. The root user is the only one who has write privilege under this directory. The “/root” directory is the root user’s home directory, and it is not the same as “/”.
  • “/bin” – User Binaries Directory – This directory contains binaries (programs). Commands which can be used by all the users of the system are located here, like: ls, ping, grep, etc.
  • “/sbin” – System Binaries Directory – This directory also contains binaries, but the commands located under this directory are used typically by the system administrator, like: fdisk, ifconfig, etc.
  • “/etc” – Configuration Files Directory – This directory contains configuration files required by all programs. It also contains startup and shutdown shell scripts used to start and stop individual programs.
  • “/dev” – Device Files Directory – This directory contains device files, like terminal devices, USB, or any other device attached to the system.
  • “/proc” – Process Information Directory – This directory contains information about system processes. This represents a virtual filesystem which contains information about the running processes. An example would be: “/proc/{pid}”, where the directory contains information about the process with that particular pid.
  • “/var” – Variable Files Directory – This directory holds files that are expected to grow in size. Such files would be the system log files, packages, database files, emails, print queues, lock files and temp files used across reboots.
  • “/tmp” – Temporary Files Directory – This directory contains temporary files created by the system and users. Files in this directory are automatically deleted when the system is rebooted.
  • “/usr” – User Programs Directory – This directory contains binaries, libraries, documentation, and source-code for non-essential applications and files used by users.
  • “/home” – Home Directory – The /home directory is used for storage of all personal user files. Examples would be: “/home/bob” or “/home/emily”.
  • “/boot” – Boot Loader Files Directory – This directory contains files that are used by the boot loader.
  • “/lib” – System Libraries Directory – This directory contains library files that are used by the binaries located in the “/bin” and “/sbin” directories.
  • “/opt” – Optional Directory – This directory contains addons and applications from different vendors.
  • “/mnt” – Mount Directory – This directory is a temporary mount directory where filesystems are usually mounted.
  • “/media” – Removable Devices Directory – Removable devices are temporarily mounted in this directory.
  • “/srv” – Service Data Directory – This directory contains data used by server-specific services.

Keep in mind that the Linux file system is a logical system, and not a physical one. Folders in the system may be distributed across different partitions, or even on different disks. Nevertheless, they are all still in the same location logically.

You should start using Linux and navigate through all these directories to learn more about the Linux Directory structure. You can get a Linux virtual server for $10 per month and learn more about Linux through the server.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.



This post first appeared on Virtual-Server.org Virtual Server, please read the originial post: here

Share the post

Linux Directory Structure Explained

×

Subscribe to Virtual-server.org Virtual Server

Get updates delivered right to your inbox!

Thank you for your subscription

×