編集の要約なし
編集の要約なし
 
(同じ利用者による、間の131版が非表示)
1行目: 1行目:
ファイルシステム階層標準(Filesystem Hierarchy Standard)。一般的にLinuxシステムは以下のようなディレクトリ構造になっている。下記はDebian11の「$man hier」の内容。
ファイルシステム階層標準(Filesystem Hierarchy Standard)。一般的にLinuxシステムは以下のようなディレクトリ構造を「<strong>おおよその骨組みの指針</strong>」としている。下記はDebian11の「$man hier」の内容でDebian11にあるものだけ。実際の構造は下記に結構いろいろと追加されている。[https://www.debian.org/releases/stable/amd64/apcs02.ja.html Debianインストールガイド]の説明も参照。


{| class="wikitable" summary="オプション"
{| class="wikitable" summary="FHS"
!ディレクトリ
!ディレクトリ
!説明
!説明
|-
|-
|/
!/
|This is the root directory.  This is where the <u>whole tree starts</u>.
|This is the root directory.  This is where the <u>whole tree starts</u>.
|-
|-
|/root
!/root
|This directory is usually the <u>home directory for the root</u> user (optional).
|This directory is usually the <u>home directory for the root</u> user (optional).
|-
|-
|/home
!/home
|On machines with home directories for users, these are usually beneath this directory, directly or not.  The structure of this directory depends on local administration decisions (optional).
|On machines with home directories for users, these are usually beneath this directory, directly or not.  The structure of this directory depends on local administration decisions (optional).
|-
|-
|/bin<br>-> usr/bin
!/bin<br>-> usr/bin
|This directory contains executable programs which are needed in <u>single user mode and to bring the system up or repair it</u>.
|This directory contains executable programs which are needed in <u>single user mode and to bring the system up or repair it</u>. This is the <u>primary directory for executable programs</u>.  Most programs <u>executed by normal users</u> which are not needed for booting or  for  repairing  the system and which are not installed locally should be placed in this directory.
|-
|-
|/usr/bin
!/sbin<br>-> usr/sbin
|This is the <u>primary directory for executable programs</u>.  Most programs <u>executed by normal users</u> which are not needed for booting or for repairing  the system and which are not installed locally should be placed in this directory.
|<u>Like /bin</u>, this directory holds <u>commands needed to boot the system</u>, but which are usually not executed by normal users. This  directory  contains program <u>binaries for system administration which are not essential for the boot process, for mounting /usr, or for system repair</u>.
|-
|-
|/sbin
!/lib<br>-> /usr/lib
|<u>Like /bin</u>, this directory holds <u>commands needed to boot the system</u>, but which are usually not executed by normal users.
|This directory should hold those <u>shared libraries that are necessary to boot the system and to run the commands in the root filesystem</u>.Object libraries, including dynamic libraries, plus some executables which usually are not invoked directly. More complicated programs may have whole subdirectories there.
|-
|-
|/boot
!/lib<qual><br>-> /usr/lib<qual>
|Contains  static  files for the boot loader.  This directory holds <u>only the files which are needed during the boot process</u>.  The map installer and configuration files should go to /sbin and /etc.  The operating system kernel (initrd for example) must be located in either / or /boot.
|These directories are variants of /lib on system which support more than one binary format requiring separate libraries (optional). These directories  are variants of /usr/lib on system which support more than one binary format requiring separate libraries, except that the symbolic link /usr/lib<qual>/X11 is not required (optional).
|-
|-
|/dev
!/usr/libexec
|Special or device files, which refer to <u>physical devices</u>.  See mknod(1).
|Directory contains <u>binaries for internal use only</u> and they are not meant to be executed directly by users shell or scripts.
|-
!/usr/lib/groff
|Files for the GNU groff document formatting system.
|-
!/boot
|Contains  <u>static  files for the boot loader</u>.  This directory holds <u>only the files which are needed during the boot process</u>.  The map installer and configuration files should go to /sbin and /etc. <u>The operating system kernel (initrd for example) must be located in either / or /boot</u>.
|-
!/dev
|Special or <u>device files, which refer to physical devices</u>.  See mknod(1).
|-
|-
|/proc
!/proc
|This  is a <u>mount point for the proc filesystem, which provides information about running processes and the kernel</u>.  This pseudo-filesystem is described in more detail in proc(5).
|This  is a <u>mount point for the proc filesystem, which provides information about running processes and the kernel</u>.  This pseudo-filesystem is described in more detail in proc(5).
|-
|-
|/sys
!/sys
|This  is a mount point for the sysfs filesystem, which <u>provides information about the kernel like /proc, but better structured</u>, following the formalism of kobject infrastructure.
|This  is a mount point for the sysfs filesystem, which <u>provides information about the kernel like /proc, but better structured</u>, following the formalism of kobject infrastructure.
|-
|-
|/run
!/run
|This directory contains <u>information which describes the system since it was booted</u>.  Once this purpose was served by /var/run and programs may continue to use it.
|This directory contains <u>information which describes the system since it was booted</u>.  Once this purpose was served by /var/run and programs may continue to use it.
|-
|-
|/tmp
!/etc
|This directory contains temporary files which <u>may be deleted with no notice, such as by a regular job</u> or at system boot up.
|}
 
===初期はカラ===
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/lost+found
|This  directory  contains  items lost in the filesystem.  These items are usually <u>chunks of files mangled as a consequence of a faulty disk or a system crash</u>.
|-
|/mnt
|This directory is a mount point for a temporarily mounted filesystem.  In some distributions, /mnt contains subdirectories intended to be used as mount points for several temporary filesystems.
|-
|/opt
|This directory should contain <u>add-on packages</u> that contain static files.
|-
|/srv
|This directory contains site-specific data that is served by this system.
|}
 
==/etc==
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/etc
|Contains <u>configuration files which are local to the machine</u>.  Some larger software packages, like X11, can have their own  subdirectories  below  /etc.Site-wide  configuration  files  may be placed here or in /usr/etc.  Nevertheless, programs should always look for these files in /etc and you may have links for these files to /usr/etc.
|Contains <u>configuration files which are local to the machine</u>.  Some larger software packages, like X11, can have their own  subdirectories  below  /etc.Site-wide  configuration  files  may be placed here or in /usr/etc.  Nevertheless, programs should always look for these files in /etc and you may have links for these files to /usr/etc.
|-
|-
|/etc/opt
!/etc/opt
|Host-specific <u>configuration files for add-on applications installed in /opt</u>.
|Host-specific <u>configuration files for add-on applications installed in /opt</u>.
|-
|-
|/etc/skel
!/etc/skel
|When a <u>new user account is created</u>, files from this directory are usually copied into the user's home directory.
|When a <u>new user account is created</u>, files from this directory are usually copied into the user's home directory.
|-
|-
|/etc/sgml
!/lib/modules
|This directory contains the configuration files for SGML (optional).
|-
|/etc/X11
| Configuration files for the X11 window system (optional).
|-
|/etc/xml
|This directory contains the configuration files for XML (optional).
|}
 
==/lib==
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/lib
|This directory should hold those <u>shared libraries that are necessary to boot the system and to run the commands in the root filesystem</u>.
|-
|/lib<qual>
|These directories are variants of /lib on system which support more than one binary format requiring separate libraries (optional).
|-
|/lib/modules
| Loadable kernel modules (optional).
| Loadable kernel modules (optional).
|}
==/media==
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/media
|This directory contains mount points <u>for removable media such as CD and DVD disks or USB sticks</u>.  On systems where more  than  one  device  exists  for mounting a certain type of media, mount directories can be created by appending a digit to the name of those available above starting with '0', but the unqualified name must also exist.
|-
|/media/floppy[1-9]
|Floppy drive (optional).
|-
|/media/cdron[1-9]
|CD-ROM drive (optional).
|-
|/media/cdrecorder
|CD writer (optional).
|-
|/media/zip[1-9]
|Zip drive (optional).
|-
|/meida/usb[1-9]
|USB drive (optional).
|}
==/usr==
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/usr
|This directory is <u>usually mounted from a separate partition</u>.  It should <u>hold only shareable, read-only data</u>, so that it can be mounted by  various  machines running Linux.
|-
|/usr/sbin
|This  directory  contains program <u>binaries for system administration which are not essential for the boot process, for mounting /usr, or for system repair</u>.
|-
|-
|/usr/bin/mh
!/tmp
|Commands for the MH mail handling system (optional).
|This directory contains temporary files <u>which may be deleted with no notice, such as by a regular job</u> or at system boot up.
|-
|-
|/usr/bin/X11
!/lost+found
|is the traditional place to look for X11 executables; on Linux, it usually is a symbolic link to /usr/X11R6/bin.
|(空)This  directory  contains  items lost in the filesystem.  These items are usually <u>chunks of files mangled as a consequence of a faulty disk or a system crash</u>.
|-
|-
|/usr/X11R6
!/mnt
|The X-Window system, version 11 release 6 (present in FHS 2.3, <u>removed in FHS 3.0</u>).
|(空)This directory is a mount point for a temporarily mounted filesystem. In some distributions, /mnt contains subdirectories intended to be used as mount points for several temporary filesystems.
|-
|-
|/usr/etc
!/media
|<u>Site-wide  configuration  files to be shared between several machines</u> may be stored in this directoryHowever, commands should always reference those files using the /etc directory. Links from files in /etc should point to the appropriate files in /usr/etc.
|(空)This directory contains mount points <u>for removable media such as CD and DVD disks or USB sticks</u>.  On systems where more  than  one  device exists for mounting a certain type of media, mount directories can be created by appending a digit to the name of those available above starting with '0', but the unqualified name must also exist.
|-
|-
|/usr/src
!/opt
|<u>Source files for different parts of the system, included with some packages for reference purposes</u>.  Don't work here with your own projects,  as  files below /usr should be read-only except when installing software (optional).
|(空)This directory should contain <u>add-on packages</u> that contain static files.
|-
|-
|/usr/src/linux
!/srv
|This  was  the  <u>traditional place for the kernel source</u>.  Some distributions put here the source for the default kernel they ship.  You should probably use another directory when building your own kernel.
|(空)This directory contains site-specific data that is served by this system.
|-
|-
|/usr/games
!'''/usr'''
|<u>Binaries for games and educational programs</u> (optional).
|This directory is <u>usually mounted from a '''separate partition'''</u>. It should <u>hold only shareable, read-only data</u>, so that it can be mounted by  various  machines running Linux.
|}
===/usr/include===
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|-
|/usr/include
!/usr/include
|Include files for <u>the C compiler</u>.
|Include files for <u>the C compiler</u>.
|-
|-
|/usr/include/bsd
!/usr/games
|BSD compatibility include files (optional).
|(空)Binaries for games and educational programs (optional).
|-
|/usr/include/X11
|Include files for the C compiler and the X-Window system.  This is usually a symbolic link to /usr/X11R6/include/X11.
|-
|/usr/include/asm
|Include files which <u>declare some assembler functions</u>.  This used to be a symbolic link to /usr/src/linux/include/asm.
|-
|/usr/include/linux
|This contains <u>information which may change from system release to system release</u> and used to be a symbolic link to /usr/src/linux/include/linux to  get  at operating-system-specific information.  ('''Note  that'''  one  should have include files there that work correctly with the current libc and in user space.  However, <u>Linux kernel source is not designed to be used with user programs and does not know anything about the libc you are using</u>.  It is very likely that things  will  break  if  you  let  /usr/include/asm  and /usr/include/linux point at a random kernel tree.  Debian systems don't do this and use headers from a known good kernel version, provided in the libc*-dev package.)
|-
|/usr/include/g++
|Include files to use with the GNU C++ compiler.
|}
 
===/usr/lib===
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/usr/lib
|Object libraries, including dynamic libraries, plus some executables which usually are not invoked directly. More complicated programs may have whole subdirectories there.
|-
|/usr/libexec
|Directory contains <u>binaries for internal use only</u> and they are not meant to be executed directly by users shell or scripts.
|-
|/usr/lib<qual>
|These  directories  are variants of /usr/lib on system which support more than one binary format requiring separate libraries, except that the symbolic link /usr/lib<qual>/X11 is not required (optional).
|-
|/usr/lib/X11
|The usual place for data files associated with X programs, and configuration files for the X system itself.  On Linux, it usually is a symbolic link to /usr/X11R6/lib/X11.
|-
|/usr/lib/gcc-lib
|contains executables and include files for the GNU C compiler, gcc(1).
|-
|/usr/lib/groff
|Files for the GNU groff document formatting system.
|-
|/usr/lib/uucp
|Files for uucp(1).
|}
 
===/usr/local===
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/usr/local
|This is where programs which are local to the site typically go.
|-
|/usr/local/bin
|Binaries for programs local to the site.
|-
|-
|/usr/local/doc
!/usr/src
|Local documentation.
|(空)<u>Source files for different parts of the system, included with some packages for reference purposes</u>.  Don't work here with your own projects,  as  files below /usr should be read-only except when installing software (optional).
|-
|-
|/usr/local/etc
!'''/usr/local'''
|Configuration files associated with locally installed programs.
|This is where <u>programs which are local to the site</u> typically go.
|-
|-
|/usr/local/games
!/usr/local/bin
|Binaries for locally installed games.
|(空)Binaries for programs local to the site.
|-
|-
|/usr/local/lib
!/usr/local/etc
|Files associated with locally installed programs.
|(空)Configuration files associated with locally installed programs.
|-
|-
|/usr/local/lib<qual>
!/usr/local/games
|These directories are variants of /usr/local/lib on system which support more than one binary format requiring separate libraries (optional).
|(空)Binaries for locally installed games.
|-
|-
|/usr/local/include
!/usr/local/include
|Header files for the local C compiler.
|(空)Header files for the local C compiler.
|-
|-
|/usr/local/info
!/usr/local/lib
|Info pages associated with locally installed programs.
|Files associated with locally installed programs. [python3.9]
|-
|-
|/usr/local/man
!/usr/local/man
|Man pages associated with locally installed programs.
|(空)Man pages associated with locally installed programs.
|-
|-
|/usr/local/sbin
!/usr/local/sbin
|Locally installed programs for system administration.
|(空)Locally installed programs for system administration.
|-
|-
|/usr/local/share
!/usr/local/share
|Local application data that can be shared among different architectures of the same OS.
|Local application data that can be shared among different architectures of the same OS.
|-
|-
|/usr/local/src
!/usr/local/src
|Source code for locally installed software.
|(空)Source code for locally installed software.
|}
 
===/usr/share===
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|-
|/usr/share
!'''/usr/share'''
|This directory contains subdirectories with <u>specific application data, that can be shared</u> among different architectures of the same  OS. Often one finds stuff here that used to live in /usr/doc or /usr/lib or /usr/man.
|This directory contains subdirectories with <u>specific application data, that can be shared</u> among different architectures of the same  OS. Often one finds stuff here that used to live in /usr/doc or /usr/lib or /usr/man.
|-
|-
|/usr/share/color
!/usr/share/dict
|Contains color management information, like International Color Consortium (ICC) Color profiles (optional).
|-
|/usr/share/dict
|Contains the word lists used by spell checkers (optional).
|Contains the word lists used by spell checkers (optional).
|-
|-
|/user/share/dict/words
!/user/share/dict/words
|List of English words (optional).
|List of English words (optional).
|-
|-
|/usr/share/doc
!/usr/share/doc
|Documentation about installed programs (optional).
|Documentation about installed programs (optional).
|-
|-
|/usr/share/games
!/user/share/info
|Static data files for games in /usr/games (optional).
|-
|/user/share/info
|Info pages go here (optional).
|Info pages go here (optional).
|-
|-
|/usr/share/local
!/usr/share/local
|Locale information goes here (optional).
|Locale information goes here (optional).
|-
|-
|/usr/share/man
!/usr/share/man
|Manual pages go here in subdirectories according to the man page sections.
|Manual pages go here in subdirectories according to the man page sections.
|-
|-
|/user/share/misc
!/user/share/misc
|Miscellaneous data that can be shared among different architectures of the same OS.
|Miscellaneous data that can be shared among different architectures of the same OS.
|-
|-
|/usr/share/nls
!/usr/share/terminfo
|The message catalogs for native language support go here (optional).
|-
|/usr/share/ppd
|Postscript Printer Definition (PPD) files (optional).
|-
|/usr/share/sgml
|Files for SGML (optional).
|-
|/usr/share/sgml/docbook
|DocBook DTD (optional).
|-
|/usr/share/sgml/tei
|TEI DTD (optional).
|-
|/usr/share/sgml/html
|HTML DTD (optional).
|-
|/usr/share/sgml/mathml
|MathML DTD (optional).
|-
|/usr/share/terminfo
|The database for terminfo (optional).
|The database for terminfo (optional).
|-
|-
|/usr/share/tmac
!/usr/sahre/xml
|Troff macros that are not distributed with groff (optional).
|-
|/usr/sahre/xml
|Files for XML (optional).
|Files for XML (optional).
|-
|-
|/usr/share/xml/docbook
!/usr/sahre/zoneinfo
|DocBook DTD (optional).
|-
|/usr/share/xml/xhtml
|XHTML DTD (optional).
|-
|/usr/share/xml/mathml
|MathML DTD (optional).
|-
|/usr/sahre/zoneinfo
|Files for timezone information (optional).
|}
 
==/var==
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|/var
|This directory contains files which may change in size, such as spool and log files.
|-
|-
|/var/account
!'''/var'''
|Process accounting logs (optional).
|This directory contains <u>files which '''may change in size'''</u>, such as spool and log files.
|-
|-
|/var/backups
!/var/backups
|Reserved for historical reasons.
|Reserved for historical reasons.
|-
|-
|/var/cache
!/var/cache
|Data cached for programs.
|Data cached for programs.
|-
|-
|/var/cache/fonts
!/var/cache/man
|Locally generated fonts (optional).
|-
|/var/cache/man
|Locally formatted man pages (optional).
|Locally formatted man pages (optional).
|-
|-
|/var/cache/www
!/var/cache/man/cat[1-9]
|WWW proxy or cache data (optional).
|These directories contain preformatted manual pages according to their man page section.
|-
|-
|/var/cache/<package>
!/var/cache/<package>
|Package specific cache data (optional).
|Package specific cache data (optional).
|-
|-
|/var/catman/cat[1-9]<br>/var/cache/man/cat[1-9]
!'''/var/lib'''
|These directories contain preformatted manual pages according to their man page section.
|Variable state information for programs.
|-
!/var/lib/misc
|Miscellaneous state data.
|-
!/var/lib/xdm
|X display manager variable data (optional).
|-
!/var/lib/<editor>
|Editor backup files and state (optional).
|-
|-
|/var/crash
!/var/lib/<name>
|System crash dumps (optional).
|These directories must be used for all distribution packaging support.
|-
|-
|/var/cron
!/var/lib/<package>
|Reserved for historical reasons.
|State data for packages and subsystems (optional).
|-
|-
|/var/games
!/var/lib/<pkgtool>
|Variable game data (optional).
|Packaging support files (optional).
|-
|-
|/var/local
!/var/local
|Variable data for /usr/local.
|(空)Variable data for /usr/local.
|-
|-
|/var/lock
!/var/lock
|Lock files are placed in this directory.  The naming convention for device lock files is LCK..<device> where <device>  is  the  device's  name  in  the filesystem. The format used is that of HDU UUCP lock files, that is, lock files contain a PID as a 10-byte ASCII decimal number, followed by a newline character.
|(空)Lock files are placed in this directory.  The naming convention for device lock files is LCK..<device> where <device>  is  the  device's  name  in  the filesystem. The format used is that of HDU UUCP lock files, that is, lock files contain a PID as a 10-byte ASCII decimal number, followed by a newline character.
|-
|-
|/var/log
!/var/log
|Miscellaneous log files.
|Miscellaneous log files.
|-
|-
|/var/opt
!/var/mail
|Variable data for /opt.
|(空)Users' mailboxes.  Replaces /var/spool/mail.
|-
!/var/opt
|(空)Variable data for /opt.
|-
|-
|/var/mail
!/var/run<br>-> /run
|Users' mailboxesReplaces /var/spool/mail.
|Run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp)Files in this directory are <u>usually cleared when the system boots</u>.
|-
|-
|/var/msgs<br>/var/preserve
!/var/spool
|Reserved for historical reasons.
|Spooled (or queued) files for various programs.
|-
|-
|/var/run
!/var/spool/cron
|Run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp).  Files in this directory are <u>usually cleared when the system boots</u>.
|Spooled jobs for cron(8).
|-
|-
|/var/tmp
!/var/spool/mail
|Like /tmp, this directory holds temporary files stored for an unspecified duration.
|(空)Replaced by /var/mail.
|-
|-
|/var/yp
!/var/tmp
|Database files for NIS, formerly known as the Sun Yellow Pages (YP).
|Like /tmp, this directory holds temporary files stored <u>for an unspecified duration</u>.
|}
|}


===/var/spool===
==MacOS 10.13 のディレクトリ構造==
{| class="wikitable" summary="オプション"
「$man hier」で表示される内容を含む。 A historical sketch of the filesystem hierarchy.  The modern OS X filesystem is documented in the “File System Programming Guide” available on Apple Developer.
 
{| class="wikitable" summary="UnixFHS"
!ディレクトリ
!ディレクトリ
!説明
!説明
|-
|-
|/var/spool
!Applications
|Spooled (or queued) files for various programs.
|一般アプリケーション群
|-
|/var/spool/at
|Spooled jobs for at(1).
|-
|/var/spool/cron
|Spooled jobs for cron(8).
|-
|/var/spool/lpd
|Spooled files for printing (optional).
|-
|-
|/var/spool/lpd/printer
!Library
|Spools for a specific printer (optional).
|アプリケーションライブラリ
|-
|-
|/var/spool/mail
!Network
|Replaced by /var/mail.
|(空)
|-
|-
|/var/spool/mqueue
!System
|Queued outgoing mail (optional).
|システムライブラリ
|-
|-
|/var/spool/news
!Users
|Spool directory for news (optional).
|一般ユーザ用ディレクトリ
|-
|-
|/var/spool/rwho
!Volumes
|Spooled files for rwhod(8) (optional).
|SSDストレージ。「/」にシンボリックリンク
|-
|-
|/var/spool/smail
!bin
|Spooled files for the smail(1) mail delivery program.
|一般ユーザ用コマンド(36個)。user utilities fundamental to both single-user and multi-user environments.
|-
|-
|/var/spool/uucp
!cores
|Spooled files for uucp(1) (optional).
|(空)
|}
 
===/var/lib===
{| class="wikitable" summary="オプション"
!ディレクトリ
!説明
|-
|-
|/var/lib
!dev
|Variable state information for programs.
|block and character device files. 沢山ある。
|-
|-
|/var/lib/color
!etc<br>-> private/etc
|Variable files containing color management information (optional).
|system configuration files and scripts.
|-
|-
|/var/lib/hwclock
!home
|State directory for hwclock (optional).
|(空)
|-
|-
|/var/lib/misc
!net
|Miscellaneous state data.
|(空)
|-
|-
|/var/lib/xdm
!private
|X display manager variable data (optional).
|/etc, /tmp, /var のシンボリックリンク先
|-
|-
|/var/lib/<editor>
!sbin
|Editor backup files and state (optional).
|システム管理者用コマンド(61個)。system programs and administration utilities fundamental to both single-user and multi-user environments.
|-
|-
|/var/lib/<name>
!tmp<br>-> private/tmp
|These directories must be used for all distribution packaging support.
|temporary files.
|-
|-
|/var/lib/<package>
!usr
|State data for packages and subsystems (optional).
|contains the majority of user utilities and applications.「/usr/bin」一般ユーザ用コマンド(975個)。「/usr/sbin」システム管理者用コマンド(246)。共有アプリ(44個)。などなど
|-
|-
|/var/lib/<pkgtool>
!var<br>-> private/var
|Packaging support files (optional).
|multi-purpose log, temporary, transient, and spool files
|}
|}

2023年4月20日 (木) 19:46時点における最新版

ファイルシステム階層標準(Filesystem Hierarchy Standard)。一般的にLinuxシステムは以下のようなディレクトリ構造を「おおよその骨組みの指針」としている。下記はDebian11の「$man hier」の内容でDebian11にあるものだけ。実際の構造は下記に結構いろいろと追加されている。Debianインストールガイドの説明も参照。

ディレクトリ 説明
/ This is the root directory. This is where the whole tree starts.
/root This directory is usually the home directory for the root user (optional).
/home On machines with home directories for users, these are usually beneath this directory, directly or not. The structure of this directory depends on local administration decisions (optional).
/bin
-> usr/bin
This directory contains executable programs which are needed in single user mode and to bring the system up or repair it. This is the primary directory for executable programs. Most programs executed by normal users which are not needed for booting or for repairing the system and which are not installed locally should be placed in this directory.
/sbin
-> usr/sbin
Like /bin, this directory holds commands needed to boot the system, but which are usually not executed by normal users. This directory contains program binaries for system administration which are not essential for the boot process, for mounting /usr, or for system repair.
/lib
-> /usr/lib
This directory should hold those shared libraries that are necessary to boot the system and to run the commands in the root filesystem.Object libraries, including dynamic libraries, plus some executables which usually are not invoked directly. More complicated programs may have whole subdirectories there.
/lib<qual>
-> /usr/lib<qual>
These directories are variants of /lib on system which support more than one binary format requiring separate libraries (optional). These directories are variants of /usr/lib on system which support more than one binary format requiring separate libraries, except that the symbolic link /usr/lib<qual>/X11 is not required (optional).
/usr/libexec Directory contains binaries for internal use only and they are not meant to be executed directly by users shell or scripts.
/usr/lib/groff Files for the GNU groff document formatting system.
/boot Contains static files for the boot loader. This directory holds only the files which are needed during the boot process. The map installer and configuration files should go to /sbin and /etc. The operating system kernel (initrd for example) must be located in either / or /boot.
/dev Special or device files, which refer to physical devices. See mknod(1).
/proc This is a mount point for the proc filesystem, which provides information about running processes and the kernel. This pseudo-filesystem is described in more detail in proc(5).
/sys This is a mount point for the sysfs filesystem, which provides information about the kernel like /proc, but better structured, following the formalism of kobject infrastructure.
/run This directory contains information which describes the system since it was booted. Once this purpose was served by /var/run and programs may continue to use it.
/etc Contains configuration files which are local to the machine. Some larger software packages, like X11, can have their own subdirectories below /etc.Site-wide configuration files may be placed here or in /usr/etc. Nevertheless, programs should always look for these files in /etc and you may have links for these files to /usr/etc.
/etc/opt Host-specific configuration files for add-on applications installed in /opt.
/etc/skel When a new user account is created, files from this directory are usually copied into the user's home directory.
/lib/modules Loadable kernel modules (optional).
/tmp This directory contains temporary files which may be deleted with no notice, such as by a regular job or at system boot up.
/lost+found (空)This directory contains items lost in the filesystem. These items are usually chunks of files mangled as a consequence of a faulty disk or a system crash.
/mnt (空)This directory is a mount point for a temporarily mounted filesystem. In some distributions, /mnt contains subdirectories intended to be used as mount points for several temporary filesystems.
/media (空)This directory contains mount points for removable media such as CD and DVD disks or USB sticks. On systems where more than one device exists for mounting a certain type of media, mount directories can be created by appending a digit to the name of those available above starting with '0', but the unqualified name must also exist.
/opt (空)This directory should contain add-on packages that contain static files.
/srv (空)This directory contains site-specific data that is served by this system.
/usr This directory is usually mounted from a separate partition. It should hold only shareable, read-only data, so that it can be mounted by various machines running Linux.
/usr/include Include files for the C compiler.
/usr/games (空)Binaries for games and educational programs (optional).
/usr/src (空)Source files for different parts of the system, included with some packages for reference purposes. Don't work here with your own projects, as files below /usr should be read-only except when installing software (optional).
/usr/local This is where programs which are local to the site typically go.
/usr/local/bin (空)Binaries for programs local to the site.
/usr/local/etc (空)Configuration files associated with locally installed programs.
/usr/local/games (空)Binaries for locally installed games.
/usr/local/include (空)Header files for the local C compiler.
/usr/local/lib Files associated with locally installed programs. [python3.9]
/usr/local/man (空)Man pages associated with locally installed programs.
/usr/local/sbin (空)Locally installed programs for system administration.
/usr/local/share Local application data that can be shared among different architectures of the same OS.
/usr/local/src (空)Source code for locally installed software.
/usr/share This directory contains subdirectories with specific application data, that can be shared among different architectures of the same OS. Often one finds stuff here that used to live in /usr/doc or /usr/lib or /usr/man.
/usr/share/dict Contains the word lists used by spell checkers (optional).
/user/share/dict/words List of English words (optional).
/usr/share/doc Documentation about installed programs (optional).
/user/share/info Info pages go here (optional).
/usr/share/local Locale information goes here (optional).
/usr/share/man Manual pages go here in subdirectories according to the man page sections.
/user/share/misc Miscellaneous data that can be shared among different architectures of the same OS.
/usr/share/terminfo The database for terminfo (optional).
/usr/sahre/xml Files for XML (optional).
/usr/sahre/zoneinfo
/var This directory contains files which may change in size, such as spool and log files.
/var/backups Reserved for historical reasons.
/var/cache Data cached for programs.
/var/cache/man Locally formatted man pages (optional).
/var/cache/man/cat[1-9] These directories contain preformatted manual pages according to their man page section.
/var/cache/<package> Package specific cache data (optional).
/var/lib Variable state information for programs.
/var/lib/misc Miscellaneous state data.
/var/lib/xdm X display manager variable data (optional).
/var/lib/<editor> Editor backup files and state (optional).
/var/lib/<name> These directories must be used for all distribution packaging support.
/var/lib/<package> State data for packages and subsystems (optional).
/var/lib/<pkgtool> Packaging support files (optional).
/var/local (空)Variable data for /usr/local.
/var/lock (空)Lock files are placed in this directory. The naming convention for device lock files is LCK..<device> where <device> is the device's name in the filesystem. The format used is that of HDU UUCP lock files, that is, lock files contain a PID as a 10-byte ASCII decimal number, followed by a newline character.
/var/log Miscellaneous log files.
/var/mail (空)Users' mailboxes. Replaces /var/spool/mail.
/var/opt (空)Variable data for /opt.
/var/run
-> /run
Run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp). Files in this directory are usually cleared when the system boots.
/var/spool Spooled (or queued) files for various programs.
/var/spool/cron Spooled jobs for cron(8).
/var/spool/mail (空)Replaced by /var/mail.
/var/tmp Like /tmp, this directory holds temporary files stored for an unspecified duration.

MacOS 10.13 のディレクトリ構造

「$man hier」で表示される内容を含む。 A historical sketch of the filesystem hierarchy. The modern OS X filesystem is documented in the “File System Programming Guide” available on Apple Developer.

ディレクトリ 説明
Applications 一般アプリケーション群
Library アプリケーションライブラリ
Network (空)
System システムライブラリ
Users 一般ユーザ用ディレクトリ
Volumes SSDストレージ。「/」にシンボリックリンク
bin 一般ユーザ用コマンド(36個)。user utilities fundamental to both single-user and multi-user environments.
cores (空)
dev block and character device files. 沢山ある。
etc
-> private/etc
system configuration files and scripts.
home (空)
net (空)
private /etc, /tmp, /var のシンボリックリンク先
sbin システム管理者用コマンド(61個)。system programs and administration utilities fundamental to both single-user and multi-user environments.
tmp
-> private/tmp
temporary files.
usr contains the majority of user utilities and applications.「/usr/bin」一般ユーザ用コマンド(975個)。「/usr/sbin」システム管理者用コマンド(246)。共有アプリ(44個)。などなど
var
-> private/var
multi-purpose log, temporary, transient, and spool files