обзор иерархии файловой системы (File system hierarchy overview)
USER PACKAGES
Programs running in user context should follow strict rules when
placing their own files in the user's home directory. The
following table lists recommended locations in the home directory
for specific types of files supplied by the vendor if the
application is installed in the home directory. (User
applications installed system-wide are covered by the rules
outlined above for vendor files.)
Table 3. Vendor package file locations under the home directory
of the user
┌──────────────────────────────┬──────────────────────────┐
│Directory
│ Purpose
│
├──────────────────────────────┼──────────────────────────┤
│~/.local/bin/ │ Package executables that │
│ │ shall appear in the │
│ │ $PATH executable search │
│ │ path. It is not │
│ │ recommended to place │
│ │ internal executables or │
│ │ executables that are not │
│ │ commonly invoked from │
│ │ the shell in this │
│ │ directory, such as │
│ │ daemon executables. As │
│ │ this directory is shared │
│ │ with most other packages │
│ │ of the user, special │
│ │ care should be taken to │
│ │ pick unique names for │
│ │ files placed here, that │
│ │ are unlikely to clash │
│ │ with other package's │
│ │ files. │
├──────────────────────────────┼──────────────────────────┤
│~/.local/lib/arch-id/ │ Public shared libraries │
│ │ of the package. As │
│ │ above, be careful with │
│ │ using overly generic │
│ │ names, and pick unique │
│ │ names for your libraries │
│ │ to place here to avoid │
│ │ name clashes. │
├──────────────────────────────┼──────────────────────────┤
│~/.local/lib/package/ │ Private, static vendor │
│ │ resources of the │
│ │ package, compatible with │
│ │ any architecture, or any │
│ │ other kind of read-only │
│ │ vendor data. │
├──────────────────────────────┼──────────────────────────┤
│~/.local/lib/arch-id/package/ │ Private other vendor │
│ │ resources of the package │
│ │ that are │
│ │ architecture-specific │
│ │ and cannot be shared │
│ │ between architectures. │
└──────────────────────────────┴──────────────────────────┘
Additional static vendor files may be installed in the
~/.local/share/ hierarchy, mirroring the subdirectories specified
in the section "Vendor-supplied operating system resources"
above.
The following directories shall be used by the package for
per-user local configuration and files created during runtime:
Table 4. User package variable file locations
┌──────────────────────────┬──────────────────────────┐
│Directory
│ Purpose
│
├──────────────────────────┼──────────────────────────┤
│~/.config/package/ │ User-specific │
│ │ configuration and state │
│ │ for the package. It is │
│ │ required to default to │
│ │ safe fallbacks if this │
│ │ configuration is │
│ │ missing. │
├──────────────────────────┼──────────────────────────┤
│$XDG_RUNTIME_DIR/package/ │ User runtime data for │
│ │ the package. │
├──────────────────────────┼──────────────────────────┤
│~/.cache/package/ │ Persistent cache data of │
│ │ the package. If this │
│ │ directory is flushed, │
│ │ the application should │
│ │ work correctly on next │
│ │ invocation, though │
│ │ possibly slowed down due │
│ │ to the need to rebuild │
│ │ any local cache files. │
│ │ The application must be │
│ │ capable of recreating │
│ │ this directory should it │
│ │ be missing and │
│ │ necessary. │
└──────────────────────────┴──────────────────────────┘