Linux Directory Structure

BCA-I yr
Operating System
Minor-II
Asst.Prof.Manju Kumawat

Unlike Windows, where each drive (C:, D:) stands on its own, Linux uses a single-rooted tree structure, with everything starting from the root directory /.

1. / – Root

  • The top-level directory.
  • Everything in Linux begins here.
  • Not to be confused with /root, which is the home directory of the root user.

2. /bin – Essential User Binaries

  • Contains basic Linux commands like lscpmvcat.
  • These are essential programs required during system boot and in single-user mode.

3. /sbin – System Binaries

  • Contains binaries for system administration, mostly used by root.
  • Examples: fsckrebootiptables.

4. /etc – Configuration Files

  • Contains all system-wide configuration files.
  • Files like /etc/passwd/etc/fstab/etc/hosts live here.

5. /dev – Device Files

  • Represents devices as files (e.g., hard drives: /dev/sda, terminals: /dev/tty).
  • These are interface files to the system's hardware.

6. /proc – Process Info

  • A virtual filesystem showing runtime system info and kernel parameters.
  • Example: /proc/cpuinfo shows processor info.

7. /var – Variable Files

  • Stores variable data like logs, mail, spool files.
  • Example: /var/log/syslog or /var/log/messages.

8. /tmp – Temporary Files

  • Temporary storage for applications.
  • Often cleared on reboot.

9. /usr – User Programs

  • Contains user-installed software and libraries.
  • Subfolders like /usr/bin/usr/lib, and /usr/share.

10. /home – User Home Directories

  • Each non-root user has their own folder inside /home.
  • E.g., /home/ec2-user/home/kiran

11. /root – Root User's Home

  • Home directory for the superuser (root).
  • Separate from /home.

12. /lib/lib64 – Shared Libraries

  • Contains essential libraries needed by /bin and /sbin programs.

13. /opt – Optional Software

  • Used for installing add-on or third-party software.

14. /mnt and /media – Mount Points

  • Temporary mount points for external storage like USB drives or network shares.

15. /boot – Boot Loader Files

  • Contains the Linux kernel, initial RAM disk, and bootloader configuration (e.g., grub.cfg).

0 comments:

Post a Comment