Skip to content

Instantly share code, notes, and snippets.

@ivangabriele
Last active December 22, 2023 13:33
Show Gist options
  • Save ivangabriele/5d646933b1851e2cbd2cd82ad8618d39 to your computer and use it in GitHub Desktop.
Save ivangabriele/5d646933b1851e2cbd2cd82ad8618d39 to your computer and use it in GitHub Desktop.
OS Directories Cheat Sheet

This cheat sheet covers the common directories in Linux, macOS, and Windows, highlighting their roles and differences.

Warning

This is a work in progress.



Linux

Binaries

  • /bin
    • Purpose: Contains essential user binaries (commands) that are needed to boot the system and to repair it.
    • Examples: ls, cp, mv, cat, mkdir.
    • Note: These binaries are required in single-user mode and are available to all users.
  • /sbin
    • Purpose: Like /bin, but contains essential system administration binaries.
    • Examples: shutdown, reboot, fdisk, ifconfig, swapon.
    • Note: Typically for system administrators' use and not part of the regular users' PATH.
  • /opt/bin (If exists)
    • Purpose: Binaries for optional or third-party software.
    • Examples: Commercial software products might use this directory.
    • Note: Often used for software not installed through the package manager and that doesn't conform to the standard Linux filesystem hierarchy.
  • /usr/bin
    • Purpose: Contains non-essential user binaries. These are not required for booting or repairing the system.
    • Examples: Most user programs like firefox, git, vim.
    • Note: Managed by the distribution's package manager.
  • /usr/sbin
    • Purpose: Non-essential system administration binaries.
    • Examples: httpd, sshd, useradd.
    • Note: Like /sbin, but for less essential system processes.
  • /usr/local/bin
    • Purpose: Locally compiled/user-installed software. This is used to install programs that are not managed by the distribution's package manager.
    • Examples: Software or scripts that an administrator compiles from source or third-party tools.
    • Note: Takes precedence over /usr/bin in PATH.
  • /usr/local/sbin
    • Purpose: Same as /usr/local/bin, but for system administration executables.
    • Examples: Locally installed system management programs.
    • Note: Not included in the PATH of regular users by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment