This cheat sheet covers the common directories in Linux, macOS, and Windows, highlighting their roles and differences.
Warning
This is a work in progress.
/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
.
- Purpose: Like
/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
inPATH
.
/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.
- Purpose: Same as