Linux File Hierarchy

Linux File Hierarchy

The Linux File Hierarchy Structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix-like operating systems. It is maintained by the Linux Foundation.

/ (Root)

Primary hierarchy root and root directory of the entire file system hierarchy. 

  • Every single file and directory starts from the root directory
  • The only root user has the right to write under this directory
  • /root is the root user’s home directory, which is not the same as /

/bin

Essential command binaries that need to be available in single-user mode; for all users, e.g., cat, ls, cp. 

  •  Contains binary executables
  • Common linux commands you need to use in single-user modes are located under this directory.
  • Commands used by all the users of the system are located here e.g. ps, ls, ping, grep, cp

/boot

Boot loader files, e.g., kernels, initrd. 

  • Kernel initrd, vmlinux, grub files are located under /boot

/dev

Essential device files, e.g., /dev/null. 

  • These include terminal devices, usb, or any device attached to the system.

/etc

Host-specific system-wide configuration files.

  • Contains configuration files required by all programs.
  • This also contains startup and shutdown shell scripts used to start/stop individual programs.
  • Example: /etc/resolv.conf, /etc/logrotate.conf.

 /home

Users’ home directories, containing saved files, personal settings, etc.

  • Home directories for all users to store their personal files.
  • example: /home/kishlay, /home/kv

/lib

Libraries essential for the binaries in /bin/ and /sbin/.

  • Library filenames are either ld* or lib*.so.*

 /media

Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).

  • Temporary mount directory for removable devices.
  • Examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer

/mnt

Temporarily mounted filesystems.

  • Temporary mount directory where sysadmins can mount filesystems.

/sbin

Essential system binaries, e.g., fsck, init, route.

  • Just like /bin, /sbin also contains binary executables.
  • The linux commands located under this directory are used typically by system administrator, for system maintenance purpose.
  • Example: iptables, reboot, fdisk, ifconfig, swapon

/proc

Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procs mount. Generally automatically generated and populated by the system, on the fly.

  • Contains information about system process.

 /srv

Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.

  • srv stands for service.
  • Contains server specific services related data.

/tmp

Temporary files. Often not preserved between system reboots, and may be severely size restricted.

  • Directory that contains temporary files created by system and users.
  • Files under this directory are deleted when system is rebooted.

 /opt

Optional application software packages.

  • Contains add-on applications from individual vendors.
  • Add-on applications should be installed under either /opt/ or /opt/ sub-directory.

/usr

Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications. 

Contains binaries, libraries, documentation, and source-code for second level programs.

  • /usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp
  • /usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, sshd, useradd, userdel
  • /usr/lib contains libraries for /usr/bin and /usr/sbin



short and precise !

回复
Abu Zafor Md Obaidullah

Network Engineer | Cybersecurity Engineer & Researcher | CEH | CCNA | JNCIA-Junos

1 年

??

回复

要查看或添加评论,请登录

Rafsan Anwar的更多文章

  • Top 10 Tips for Freshers Preparing a CV for Cybersecurity Jobs

    Top 10 Tips for Freshers Preparing a CV for Cybersecurity Jobs

    Creating a compelling CV is a critical step for freshers aspiring to break into the cybersecurity field. As…

  • Mastering File Compression in Linux: A Guide to zip, gzip, bzip2, and tar

    Mastering File Compression in Linux: A Guide to zip, gzip, bzip2, and tar

    In Linux, file compression is an essential skill for managing disk space and transferring large files efficiently. By…

    1 条评论
  • Advanced Package Tool (APT) in Linux

    Advanced Package Tool (APT) in Linux

    When it comes to managing software on a Linux system, the Advanced Package Tool (APT) is one of the most powerful and…

  • Permission Management in Linux File Systems

    Permission Management in Linux File Systems

    When working with Linux, understanding and managing file permissions is crucial for both system security and effective…

    1 条评论
  • Linux File and Folder Management

    Linux File and Folder Management

    Managing files and folders in Linux is a fundamental skill for both beginners and seasoned users. This article will…

    3 条评论
  • A Beginner's Guide to the Vi Editor in Linux

    A Beginner's Guide to the Vi Editor in Linux

    The Vi editor is a powerful and versatile text editor that comes pre-installed on almost all Unix-like operating…

  • User Management in Linux: A Comprehensive Guide

    User Management in Linux: A Comprehensive Guide

    Managing users in Linux is a fundamental aspect of system administration. Effective user management ensures that only…

  • Cyber Kill Chain

    Cyber Kill Chain

    In the ever-evolving landscape of cybersecurity, understanding and anticipating potential threats is crucial for…

  • Skills Require of an Ethical Hackers or Pentester

    Skills Require of an Ethical Hackers or Pentester

    In today's digital landscape, where cyber threats are becoming increasingly sophisticated, the role of ethical hackers…

  • The Next Generation Firewall

    The Next Generation Firewall

    In today's interconnected world, where cyber threats are growing in complexity and frequency, the need for robust…

社区洞察

其他会员也浏览了