Understanding Linux Filesystem Hierarchy: Exploring Root Directory Structure and Common Directories

Understanding Linux Filesystem Hierarchy: Exploring Root Directory Structure and Common Directories

linux filesystem

The main difference between the root user and regular users lies in the level of privileges and access they have on a Linux system:

Root User (Superuser):

  1.  It is also called superuser and has the ability to do everything on the system as there are no restrictions to it.
  2. Root can run any command, read or change any file, and configure the system.
  3. In the context of this user, he or she possesses the power to execute essential system tasks, including software installation, system configuration, and user account administration.
  4. Privileged users should be careful with Root access because any wrongdoing or misuse can permanently damage the stability and security of the system.
  5. Generally, it is recommended to stay away from using the root account for routine tasks but use it only when it’s necessary.

Regular Users:

  1. Regular users are accounts intended for personal or ensemble use of the system limited to the assigned duties.
  2. Such users only have a right to access system resources with limitations or any attempt to modify essential system files or settings may be prevented.
  3. Generally speaking, only specific files and directories are available to users with the proper credentials.
  4. They are not allowed to deal with the system-wide administration tasks or make system configuration changes that would affect other users or entire system operation.
  5. Regular users are often used for the day-to-day utilities, such as using file systems, application and interaction, without affecting the system performance.
  6. To recap, root can be viewed as superuser who has complete administrative privileges and with unconstricted access to the system, while regular users are limited in their rights and the need to adhere to certain limits is apparent for the maintenance of system security and stability

Exploring Root Directory Structure And Common Directories 

In Linux, by filesystem hierarchically organized, each directory has a respective field. Here are some common directories found in the root (/) directory of a Linux system:

  1. /bin: Consists of the most essential binary executable files (commands) of the system that are needed during the booting process and repair operations, such as ls, cp, mv, and so on.
  2. /boot: It contains the files needed for the boot process, such as the Linux kernel, initrd (initial RAM disk), and the configuration files of the boot loader.
  3. /dev: It is a dump of device files created for all hardware devices, connected to the system, such as hard drives, USB drives and terminals.
  4. /etc: Contains the configuration settings for the system-wide programs and services such as the network configuration, user authentication, and system startup scripts.
  5. /home: The users personal directory files for regular users. Normally, the user own a subfolder here that is utilized for storing their personal files and personal settings.
  6. /lib and /lib64: Stores the libraries used by the programs in the /bin and /sbin directories, as well as others in the system.
  7. /mnt and /media: Acting as mounts of temporary or external filesystems for example USB drives, CD rewritable and other network shares.
  8. /opt: The reason of installing a package of software packages which are not the on-default of the system installation is used for this case.
  9. /root: Home folder for the superuser/ administrator (root user). This is the same as the main folder called “My Documents” for user number 0, or the root user.
  10. /sbin: Contains an archive of all these essential system commands that are used to manage and maintain the system along with monitoring. Examples include fdisk, ifconfig, iptables, and so on.
  11. /tmp: Employed for the purpose of storing files which are usually deleted when the system is rebooted.
  12. /var: Contain variable data files like log, spool, and temporary files which will increase during the normal functioning of the system.
  13. /usr: Consists of user-oriented programs, libraries, manuals, and other files that are not necessary for the system boot.
  14. /proc: Command diverts the assignments for the virtual file system which involve processes and system resources as files and directories. This is not a regular file system but an interface for viewing the working system in realtime.
  15. /sys: Another virtual file system which contains information about hardware and kernel configurations.
  16. /srv: Contains information of services performed by the system, who are, HTTP (web) servers, FTP servers, or version control systems.
  17. /run: Tmp file system to keep system data like PID files and sockets. It is often mounted into the tmpfs file system, which is in the RAM and will be erased upon system reboot.

These directories lend the system an order and structure that is essential in keeping system files, user files, and configuration settings integrated and available at all times.

Leave a Reply

Your email address will not be published. Required fields are marked *