1FILE-HIERARCHY(7)               file-hierarchy               FILE-HIERARCHY(7)
2
3
4

NAME

6       file-hierarchy - File system hierarchy overview
7

DESCRIPTION

9       Operating systems using the systemd(1) system and service manager are
10       organized based on a file system hierarchy inspired by UNIX, more
11       specifically the hierarchy described in the File System Hierarchy[1]
12       specification and hier(7), with various extensions, partially
13       documented in the XDG Base Directory Specification[2] and XDG User
14       Directories[3]. This manual page describes a more generalized, though
15       minimal and modernized subset of these specifications that defines more
16       strictly the suggestions and restrictions systemd makes on the file
17       system hierarchy.
18
19       Many of the paths described here can be queried with the systemd-
20       path(1) tool.
21

GENERAL STRUCTURE

23       /
24           The file system root. Usually writable, but this is not required.
25           Possibly a temporary file system ("tmpfs"). Not shared with other
26           hosts (unless read-only).
27
28       /boot/
29           The boot partition used for bringing up the system. On EFI systems,
30           this is possibly the EFI System Partition (ESP), also see systemd-
31           gpt-auto-generator(8). This directory is usually strictly local to
32           the host, and should be considered read-only, except when a new
33           kernel or boot loader is installed. This directory only exists on
34           systems that run on physical or emulated hardware that requires
35           boot loaders.
36
37       /efi/
38           If the boot partition /boot/ is maintained separately from the EFI
39           System Partition (ESP), the latter is mounted here. Tools that need
40           to operate on the EFI system partition should look for it at this
41           mount point first, and fall back to /boot/ — if the former doesn't
42           qualify (for example if it is not a mount point or does not have
43           the correct file system type MSDOS_SUPER_MAGIC).
44
45       /etc/
46           System-specific configuration. This directory may or may not be
47           read-only. Frequently, this directory is pre-populated with
48           vendor-supplied configuration files, but applications should not
49           make assumptions about this directory being fully populated or
50           populated at all, and should fall back to defaults if configuration
51           is missing.
52
53       /home/
54           The location for normal user's home directories. Possibly shared
55           with other systems, and never read-only. This directory should only
56           be used for normal users, never for system users. This directory
57           and possibly the directories contained within it might only become
58           available or writable in late boot or even only after user
59           authentication. This directory might be placed on
60           limited-functionality network file systems, hence applications
61           should not assume the full set of file API is available on this
62           directory. Applications should generally not reference this
63           directory directly, but via the per-user $HOME environment
64           variable, or via the home directory field of the user database.
65
66       /root/
67           The home directory of the root user. The root user's home directory
68           is located outside of /home/ in order to make sure the root user
69           may log in even without /home/ being available and mounted.
70
71       /srv/
72           The place to store general server payload, managed by the
73           administrator. No restrictions are made how this directory is
74           organized internally. Generally writable, and possibly shared among
75           systems. This directory might become available or writable only
76           very late during boot.
77
78       /tmp/
79           The place for small temporary files. This directory is usually
80           mounted as a "tmpfs" instance, and should hence not be used for
81           larger files. (Use /var/tmp/ for larger files.) This directory is
82           usually flushed at boot-up. Also, files that are not accessed
83           within a certain time may be automatically deleted.
84
85           If applications find the environment variable $TMPDIR set, they
86           should use the directory specified in it instead of /tmp/ (see
87           environ(7) and IEEE Std 1003.1[4] for details).
88
89           Since /tmp/ is accessible to other users of the system, it is
90           essential that files and subdirectories under this directory are
91           only created with mkstemp(3), mkdtemp(3), and similar calls. For
92           more details, see Using /tmp/ and /var/tmp/ Safely[5].
93

RUNTIME DATA

95       /run/
96           A "tmpfs" file system for system packages to place runtime data,
97           socket files, and similar. This directory is flushed on boot, and
98           generally writable for privileged programs only. Always writable.
99
100       /run/log/
101           Runtime system logs. System components may place private logs in
102           this directory. Always writable, even when /var/log/ might not be
103           accessible yet.
104
105       /run/user/
106           Contains per-user runtime directories, each usually individually
107           mounted "tmpfs" instances. Always writable, flushed at each reboot
108           and when the user logs out. User code should not reference this
109           directory directly, but via the $XDG_RUNTIME_DIR environment
110           variable, as documented in the XDG Base Directory Specification[2].
111

VENDOR-SUPPLIED OPERATING SYSTEM RESOURCES

113       /usr/
114           Vendor-supplied operating system resources. Usually read-only, but
115           this is not required. Possibly shared between multiple hosts. This
116           directory should not be modified by the administrator, except when
117           installing or removing vendor-supplied packages.
118
119       /usr/bin/
120           Binaries and executables for user commands that shall appear in the
121           $PATH search path. It is recommended not to place binaries in this
122           directory that are not useful for invocation from a shell (such as
123           daemon binaries); these should be placed in a subdirectory of
124           /usr/lib/ instead.
125
126       /usr/include/
127           C and C++ API header files of system libraries.
128
129       /usr/lib/
130           Static, private vendor data that is compatible with all
131           architectures (though not necessarily architecture-independent).
132           Note that this includes internal executables or other binaries that
133           are not regularly invoked from a shell. Such binaries may be for
134           any architecture supported by the system. Do not place public
135           libraries in this directory, use $libdir (see below), instead.
136
137       /usr/lib/arch-id/
138           Location for placing dynamic libraries into, also called $libdir.
139           The architecture identifier to use is defined on Multiarch
140           Architecture Specifiers (Tuples)[6] list. Legacy locations of
141           $libdir are /usr/lib/, /usr/lib64/. This directory should not be
142           used for package-specific data, unless this data is
143           architecture-dependent, too. To query $libdir for the primary
144           architecture of the system, invoke:
145
146               # systemd-path system-library-arch
147
148       /usr/share/
149           Resources shared between multiple packages, such as documentation,
150           man pages, time zone information, fonts and other resources.
151           Usually, the precise location and format of files stored below this
152           directory is subject to specifications that ensure
153           interoperability.
154
155       /usr/share/doc/
156           Documentation for the operating system or system packages.
157
158       /usr/share/factory/etc/
159           Repository for vendor-supplied default configuration files. This
160           directory should be populated with pristine vendor versions of all
161           configuration files that may be placed in /etc/. This is useful to
162           compare the local configuration of a system with vendor defaults
163           and to populate the local configuration with defaults.
164
165       /usr/share/factory/var/
166           Similar to /usr/share/factory/etc/, but for vendor versions of
167           files in the variable, persistent data directory /var/.
168

PERSISTENT VARIABLE SYSTEM DATA

170       /var/
171           Persistent, variable system data. Writable during normal system
172           operation. This directory might be pre-populated with
173           vendor-supplied data, but applications should be able to
174           reconstruct necessary files and directories in this subhierarchy
175           should they be missing, as the system might start up without this
176           directory being populated. Persistency is recommended, but
177           optional, to support ephemeral systems. This directory might become
178           available or writable only very late during boot. Components that
179           are required to operate during early boot hence shall not
180           unconditionally rely on this directory.
181
182       /var/cache/
183           Persistent system cache data. System components may place
184           non-essential data in this directory. Flushing this directory
185           should have no effect on operation of programs, except for
186           increased runtimes necessary to rebuild these caches.
187
188       /var/lib/
189           Persistent system data. System components may place private data in
190           this directory.
191
192       /var/log/
193           Persistent system logs. System components may place private logs in
194           this directory, though it is recommended to do most logging via the
195           syslog(3) and sd_journal_print(3) calls.
196
197       /var/spool/
198           Persistent system spool data, such as printer or mail queues.
199
200       /var/tmp/
201           The place for larger and persistent temporary files. In contrast to
202           /tmp/, this directory is usually mounted from a persistent physical
203           file system and can thus accept larger files. (Use /tmp/ for small
204           ephemeral files.) This directory is generally not flushed at
205           boot-up, but time-based cleanup of files that have not been
206           accessed for a certain time is applied.
207
208           If applications find the environment variable $TMPDIR set, they
209           should use the directory specified in it instead of /var/tmp/ (see
210           environ(7) for details).
211
212           The same security restrictions as with /tmp/ apply: mkstemp(3),
213           mkdtemp(3), and similar calls should be used. For further details
214           about this directory, see Using /tmp/ and /var/tmp/ Safely[5].
215

VIRTUAL KERNEL AND API FILE SYSTEMS

217       /dev/
218           The root directory for device nodes. Usually, this directory is
219           mounted as a "devtmpfs" instance, but might be of a different type
220           in sandboxed/containerized setups. This directory is managed
221           jointly by the kernel and systemd-udevd(8), and should not be
222           written to by other components. A number of special purpose virtual
223           file systems might be mounted below this directory.
224
225       /dev/shm/
226           Place for POSIX shared memory segments, as created via shm_open(3).
227           This directory is flushed on boot, and is a "tmpfs" file system.
228           Since all users have write access to this directory, special care
229           should be taken to avoid name clashes and vulnerabilities. For
230           normal users, shared memory segments in this directory are usually
231           deleted when the user logs out. Usually, it is a better idea to use
232           memory mapped files in /run/ (for system programs) or
233           $XDG_RUNTIME_DIR (for user programs) instead of POSIX shared memory
234           segments, since these directories are not world-writable and hence
235           not vulnerable to security-sensitive name clashes.
236
237       /proc/
238           A virtual kernel file system exposing the process list and other
239           functionality. This file system is mostly an API to interface with
240           the kernel and not a place where normal files may be stored. For
241           details, see proc(5). A number of special purpose virtual file
242           systems might be mounted below this directory.
243
244       /proc/sys/
245           A hierarchy below /proc/ that exposes a number of kernel tunables.
246           The primary way to configure the settings in this API file tree is
247           via sysctl.d(5) files. In sandboxed/containerized setups, this
248           directory is generally mounted read-only.
249
250       /sys/
251           A virtual kernel file system exposing discovered devices and other
252           functionality. This file system is mostly an API to interface with
253           the kernel and not a place where normal files may be stored. In
254           sandboxed/containerized setups, this directory is generally mounted
255           read-only. A number of special purpose virtual file systems might
256           be mounted below this directory.
257
258       /sys/fs/cgroup/
259           A virtual kernel file system exposing process control groups
260           (cgroups). This file system is an API to interface with the kernel
261           and not a place where normal files may be stored. On current
262           systems running in the default "unified" mode, this directory
263           serves as the mount point for the "cgroup2" filesystem, which
264           provides a unified cgroup hierarchy for all resource controllers.
265           On systems with non-default configurations, this directory may
266           instead be a tmpfs filesystem containing mount points for various
267           "cgroup" (v1) resource controllers; in such configurations, if
268           "cgroup2" is mounted it will be mounted on /sys/fs/cgroup/unified/,
269           but cgroup2 will not have resource controllers attached. In
270           sandboxed/containerized setups, this directory may either not exist
271           or may include a subset of functionality.
272
274       /bin/, /sbin/, /usr/sbin/
275           These compatibility symlinks point to /usr/bin/, ensuring that
276           scripts and binaries referencing these legacy paths correctly find
277           their binaries.
278
279       /lib/
280           This compatibility symlink points to /usr/lib/, ensuring that
281           programs referencing this legacy path correctly find their
282           resources.
283
284       /lib64/
285           On some architecture ABIs, this compatibility symlink points to
286           $libdir, ensuring that binaries referencing this legacy path
287           correctly find their dynamic loader. This symlink only exists on
288           architectures whose ABI places the dynamic loader in this path.
289
290       /var/run/
291           This compatibility symlink points to /run/, ensuring that programs
292           referencing this legacy path correctly find their runtime data.
293

HOME DIRECTORY

295       User applications may want to place files and directories in the user's
296       home directory. They should follow the following basic structure. Note
297       that some of these directories are also standardized (though more
298       weakly) by the XDG Base Directory Specification[2]. Additional
299       locations for high-level user resources are defined by
300       xdg-user-dirs[3].
301
302       ~/.cache/
303           Persistent user cache data. User programs may place non-essential
304           data in this directory. Flushing this directory should have no
305           effect on operation of programs, except for increased runtimes
306           necessary to rebuild these caches. If an application finds
307           $XDG_CACHE_HOME set, it should use the directory specified in it
308           instead of this directory.
309
310       ~/.config/
311           Application configuration. When a new user is created, this
312           directory will be empty or not exist at all. Applications should
313           fall back to defaults should their configuration in this directory
314           be missing. If an application finds $XDG_CONFIG_HOME set, it should
315           use the directory specified in it instead of this directory.
316
317       ~/.local/bin/
318           Executables that shall appear in the user's $PATH search path. It
319           is recommended not to place executables in this directory that are
320           not useful for invocation from a shell; these should be placed in a
321           subdirectory of ~/.local/lib/ instead. Care should be taken when
322           placing architecture-dependent binaries in this place, which might
323           be problematic if the home directory is shared between multiple
324           hosts with different architectures.
325
326       ~/.local/lib/
327           Static, private vendor data that is compatible with all
328           architectures.
329
330       ~/.local/lib/arch-id/
331           Location for placing public dynamic libraries. The architecture
332           identifier to use is defined on Multiarch Architecture Specifiers
333           (Tuples)[6] list.
334
335       ~/.local/share/
336           Resources shared between multiple packages, such as fonts or
337           artwork. Usually, the precise location and format of files stored
338           below this directory is subject to specifications that ensure
339           interoperability. If an application finds $XDG_DATA_HOME set, it
340           should use the directory specified in it instead of this directory.
341
342       ~/.local/state/
343           Application state. When a new user is created, this directory will
344           be empty or not exist at all. Applications should fall back to
345           defaults should their state in this directory be missing. If an
346           application finds $XDG_STATE_HOME set, it should use the directory
347           specified in it instead of this directory.
348

WRITE ACCESS

350   Unprivileged Write Access
351       Unprivileged processes generally lack write access to most of the
352       hierarchy.
353
354       The exceptions for normal users are /tmp/, /var/tmp/, /dev/shm/, as
355       well as the home directory $HOME (usually found below /home/) and the
356       runtime directory $XDG_RUNTIME_DIR (found below /run/user/) of the
357       user, which are all writable.
358
359       For unprivileged system processes, only /tmp/, /var/tmp/ and /dev/shm/
360       are writable. If an unprivileged system process needs a private
361       writable directory in /var/ or /run/, it is recommended to either
362       create it before dropping privileges in the daemon code, to create it
363       via tmpfiles.d(5) fragments during boot, or via the StateDirectory= and
364       RuntimeDirectory= directives of service units (see systemd.unit(5) for
365       details).
366
367       /tmp/, /var/tmp/ and /dev/shm/ should be mounted nosuid and nodev,
368       which means that set-user-id mode and character or block special
369       devices are not interpreted on those file systems. In general it is not
370       possible to mount them noexec, because various programs use those
371       directories for dynamically generated or optimized code, and with that
372       flag those use cases would break. Using this flag is OK on
373       special-purpose installations or systems where all software that may be
374       installed is known and doesn't require such functionality. See the
375       discussion of nosuid/nodev/noexec in mount(8) and PROT_EXEC in mmap(2).
376
377   Lack of Write Access on Read-Only Systems and during System Recovery
378       As noted above, some systems operate with the /usr and /etc hierarchies
379       mounted read-only, possibly only allowing write access during package
380       upgrades. Other part of the hierarchy are generally mounted read-write
381       (in particular /var and /var/tmp), but may be read-only when the kernel
382       remounts the file system read-only in response to errors, or when the
383       system is booted read-only for recovery purposes. To the extent
384       reasonable, applications should be prepared to execute without write
385       access, so that for example, failure to save non-essential data to
386       /var/cache/ or failure to create a custom log file under /var/log does
387       not prevent the application from running.
388
389       The /run/ directory is available since the earliest boot and is always
390       writable. It should be used for any runtime data and sockets, so that
391       write access to e.g.  /etc or /var is not needed.
392

NODE TYPES

394       Unix file systems support different types of file nodes, including
395       regular files, directories, symlinks, character and block device nodes,
396       sockets and FIFOs.
397
398       It is strongly recommended that /dev/ is the only location below which
399       device nodes shall be placed. Similarly, /run/ shall be the only
400       location to place sockets and FIFOs. Regular files, directories and
401       symlinks may be used in all directories.
402

SYSTEM PACKAGES

404       Developers of system packages should follow strict rules when placing
405       their files in the file system. The following table lists recommended
406       locations for specific types of files supplied by the vendor.
407
408       Table 1. System package vendor files locations
409       ┌──────────────────────────┬────────────────────────────┐
410Directory                 Purpose                    
411       ├──────────────────────────┼────────────────────────────┤
412       │/usr/bin/                 │ Package executables that   │
413       │                          │ shall appear in the $PATH
414       │                          │ executable search path,    │
415       │                          │ compiled for any of the    │
416       │                          │ supported architectures    │
417       │                          │ compatible with the        │
418       │                          │ operating system. It is    │
419       │                          │ not recommended to place   │
420       │                          │ internal binaries or       │
421       │                          │ binaries that are not      │
422       │                          │ commonly invoked from the  │
423       │                          │ shell in this directory,   │
424       │                          │ such as daemon binaries.   │
425       │                          │ As this directory is       │
426       │                          │ shared with most other     │
427       │                          │ packages of the system,    │
428       │                          │ special care should be     │
429       │                          │ taken to pick unique names │
430       │                          │ for files placed here,     │
431       │                          │ that are unlikely to clash │
432       │                          │ with other package's       │
433       │                          │ files.                     │
434       ├──────────────────────────┼────────────────────────────┤
435       │/usr/lib/arch-id/         │ Public shared libraries of │
436       │                          │ the package. As above, be  │
437       │                          │ careful with using too     │
438       │                          │ generic names, and pick    │
439       │                          │ unique names for your      │
440       │                          │ libraries to place here to │
441       │                          │ avoid name clashes.        │
442       ├──────────────────────────┼────────────────────────────┤
443       │/usr/lib/package/         │ Private static vendor      │
444       │                          │ resources of the package,  │
445       │                          │ including private binaries │
446       │                          │ and libraries, or any      │
447       │                          │ other kind of read-only    │
448       │                          │ vendor data.               │
449       ├──────────────────────────┼────────────────────────────┤
450       │/usr/lib/arch-id/package/ │ Private other vendor       │
451       │                          │ resources of the package   │
452       │                          │ that are                   │
453       │                          │ architecture-specific and  │
454       │                          │ cannot be shared between   │
455       │                          │ architectures. Note that   │
456       │                          │ this generally does not    │
457       │                          │ include private            │
458       │                          │ executables since binaries │
459       │                          │ of a specific architecture │
460       │                          │ may be freely invoked from │
461       │                          │ any other supported system │
462       │                          │ architecture.              │
463       ├──────────────────────────┼────────────────────────────┤
464       │/usr/include/package/     │ Public C/C++ APIs of       │
465       │                          │ public shared libraries of │
466       │                          │ the package.               │
467       └──────────────────────────┴────────────────────────────┘
468
469       Additional static vendor files may be installed in the /usr/share/
470       hierarchy to the locations defined by the various relevant
471       specifications.
472
473       The following directories shall be used by the package for local
474       configuration and files created during runtime:
475
476       Table 2. System package variable files locations
477       ┌────────────────────┬────────────────────────────┐
478Directory           Purpose                    
479       ├────────────────────┼────────────────────────────┤
480       │/etc/package/       │ System-specific            │
481       │                    │ configuration for the      │
482       │                    │ package. It is recommended │
483       │                    │ to default to safe         │
484       │                    │ fallbacks if this          │
485       │                    │ configuration is missing,  │
486       │                    │ if this is possible.       │
487       │                    │ Alternatively, a           │
488       │                    │ tmpfiles.d(5) fragment may │
489       │                    │ be used to copy or symlink │
490       │                    │ the necessary files and    │
491       │                    │ directories from           │
492       │                    │ /usr/share/factory/ during │
493       │                    │ boot, via the "L" or "C"   │
494       │                    │ directives.                │
495       ├────────────────────┼────────────────────────────┤
496       │/run/package/       │ Runtime data for the       │
497       │                    │ package. Packages must be  │
498       │                    │ able to create the         │
499       │                    │ necessary subdirectories   │
500       │                    │ in this tree on their own, │
501       │                    │ since the directory is     │
502       │                    │ flushed automatically on   │
503       │                    │ boot. Alternatively, a     │
504       │                    │ tmpfiles.d(5) fragment may │
505       │                    │ be used to create the      │
506       │                    │ necessary directories      │
507       │                    │ during boot, or the        │
508       │                    │ RuntimeDirectory=
509       │                    │ directive of service units │
510       │                    │ may be used to create them │
511       │                    │ at service startup (see    │
512       │                    │ systemd.unit(5) for        │
513       │                    │ details).                  │
514       ├────────────────────┼────────────────────────────┤
515       │/run/log/package/   │ Runtime log data for the   │
516       │                    │ package. As above, the     │
517       │                    │ package needs to make sure │
518       │                    │ to create this directory   │
519       │                    │ if necessary, as it will   │
520       │                    │ be flushed on every boot.  │
521       ├────────────────────┼────────────────────────────┤
522       │/var/cache/package/ │ Persistent cache data of   │
523       │                    │ the package. If this       │
524       │                    │ directory is flushed, the  │
525       │                    │ application should work    │
526       │                    │ correctly on next          │
527       │                    │ invocation, though         │
528       │                    │ possibly slowed down due   │
529       │                    │ to the need to rebuild any │
530       │                    │ local cache files. The     │
531       │                    │ application must be        │
532       │                    │ capable of recreating this │
533       │                    │ directory should it be     │
534       │                    │ missing and necessary. To  │
535       │                    │ create an empty directory, │
536       │                    │ a tmpfiles.d(5) fragment   │
537       │                    │ or the CacheDirectory=
538       │                    │ directive of service units │
539       │                    │ (see systemd.unit(5)) may  │
540       │                    │ be used.                   │
541       ├────────────────────┼────────────────────────────┤
542       │/var/lib/package/   │ Persistent private data of │
543       │                    │ the package. This is the   │
544       │                    │ primary place to put       │
545       │                    │ persistent data that does  │
546       │                    │ not fall into the other    │
547       │                    │ categories listed.         │
548       │                    │ Packages should be able to │
549       │                    │ create the necessary       │
550       │                    │ subdirectories in this     │
551       │                    │ tree on their own, since   │
552       │                    │ the directory might be     │
553       │                    │ missing on boot. To create │
554       │                    │ an empty directory, a      │
555       │                    │ tmpfiles.d(5) fragment or  │
556       │                    │ the StateDirectory=
557       │                    │ directive of service units │
558       │                    │ (see systemd.unit(5)) may  │
559       │                    │ be used.                   │
560       ├────────────────────┼────────────────────────────┤
561       │/var/log/package/   │ Persistent log data of the │
562       │                    │ package. As above, the     │
563       │                    │ package should make sure   │
564       │                    │ to create this directory   │
565       │                    │ if necessary, possibly     │
566       │                    │ using tmpfiles.d(5) or     │
567       │                    │ LogsDirectory= (see        │
568       │                    │ systemd.exec(5)), as it    │
569       │                    │ might be missing.          │
570       ├────────────────────┼────────────────────────────┤
571       │/var/spool/package/ │ Persistent spool/queue     │
572       │                    │ data of the package. As    │
573       │                    │ above, the package should  │
574       │                    │ make sure to create this   │
575       │                    │ directory if necessary, as │
576       │                    │ it might be missing.       │
577       └────────────────────┴────────────────────────────┘
578

USER PACKAGES

580       Programs running in user context should follow strict rules when
581       placing their own files in the user's home directory. The following
582       table lists recommended locations in the home directory for specific
583       types of files supplied by the vendor if the application is installed
584       in the home directory. (User applications installed system-wide are
585       covered by the rules outlined above for vendor files.)
586
587       Table 3. Vendor package file locations under the home directory of the
588       user
589       ┌──────────────────────────────┬────────────────────────────┐
590Directory                     Purpose                    
591       ├──────────────────────────────┼────────────────────────────┤
592       │~/.local/bin/                 │ Package executables that   │
593       │                              │ shall appear in the $PATH
594       │                              │ executable search path. It │
595       │                              │ is not recommended to      │
596       │                              │ place internal executables │
597       │                              │ or executables that are    │
598       │                              │ not commonly invoked from  │
599       │                              │ the shell in this          │
600       │                              │ directory, such as daemon  │
601       │                              │ executables. As this       │
602       │                              │ directory is shared with   │
603       │                              │ most other packages of the │
604       │                              │ user, special care should  │
605       │                              │ be taken to pick unique    │
606       │                              │ names for files placed     │
607       │                              │ here, that are unlikely to │
608       │                              │ clash with other package's │
609       │                              │ files.                     │
610       ├──────────────────────────────┼────────────────────────────┤
611       │~/.local/lib/arch-id/         │ Public shared libraries of │
612       │                              │ the package. As above, be  │
613       │                              │ careful with using overly  │
614       │                              │ generic names, and pick    │
615       │                              │ unique names for your      │
616       │                              │ libraries to place here to │
617       │                              │ avoid name clashes.        │
618       ├──────────────────────────────┼────────────────────────────┤
619       │~/.local/lib/package/         │ Private, static vendor     │
620       │                              │ resources of the package,  │
621       │                              │ compatible with any        │
622       │                              │ architecture, or any other │
623       │                              │ kind of read-only vendor   │
624       │                              │ data.                      │
625       ├──────────────────────────────┼────────────────────────────┤
626       │~/.local/lib/arch-id/package/ │ Private other vendor       │
627       │                              │ resources of the package   │
628       │                              │ that are                   │
629       │                              │ architecture-specific and  │
630       │                              │ cannot be shared between   │
631       │                              │ architectures.             │
632       └──────────────────────────────┴────────────────────────────┘
633
634       Additional static vendor files may be installed in the ~/.local/share/
635       hierarchy, mirroring the subdirectories specified in the section
636       "Vendor-supplied operating system resources" above.
637
638       The following directories shall be used by the package for per-user
639       local configuration and files created during runtime:
640
641       Table 4. User package variable file locations
642       ┌──────────────────────────┬────────────────────────────┐
643Directory                 Purpose                    
644       ├──────────────────────────┼────────────────────────────┤
645       │~/.config/package/        │ User-specific              │
646       │                          │ configuration and state    │
647       │                          │ for the package. It is     │
648       │                          │ required to default to     │
649       │                          │ safe fallbacks if this     │
650       │                          │ configuration is missing.  │
651       ├──────────────────────────┼────────────────────────────┤
652$XDG_RUNTIME_DIR/package/ │ User runtime data for the  │
653       │                          │ package.                   │
654       ├──────────────────────────┼────────────────────────────┤
655       │~/.cache/package/         │ Persistent cache data of   │
656       │                          │ the package. If this       │
657       │                          │ directory is flushed, the  │
658       │                          │ application should work    │
659       │                          │ correctly on next          │
660       │                          │ invocation, though         │
661       │                          │ possibly slowed down due   │
662       │                          │ to the need to rebuild any │
663       │                          │ local cache files. The     │
664       │                          │ application must be        │
665       │                          │ capable of recreating this │
666       │                          │ directory should it be     │
667       │                          │ missing and necessary.     │
668       └──────────────────────────┴────────────────────────────┘
669

SEE ALSO

671       systemd(1), hier(7), systemd-path(1), systemd-gpt-auto-generator(8),
672       sysctl.d(5), tmpfiles.d(5), pkg-config(1), systemd.unit(5)
673

NOTES

675        1. File System Hierarchy
676           http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html
677
678        2. XDG Base Directory Specification
679           https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
680
681        3. XDG User Directories
682           https://www.freedesktop.org/wiki/Software/xdg-user-dirs
683
684        4. IEEE Std 1003.1
685           http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
686
687        5. Using /tmp/ and /var/tmp/ Safely
688           https://systemd.io/TEMPORARY_DIRECTORIES
689
690        6. Multiarch Architecture Specifiers (Tuples)
691           https://wiki.debian.org/Multiarch/Tuples
692
693
694
695systemd 254                                                  FILE-HIERARCHY(7)
Impressum