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 and state. When a new user is created,
312           this directory will be empty or not exist at all. Applications
313           should fall back to defaults should their configuration or state in
314           this directory be missing. If an application finds $XDG_CONFIG_HOME
315           set, it should use the directory specified in it instead of this
316           directory.
317
318       ~/.local/bin/
319           Executables that shall appear in the user's $PATH search path. It
320           is recommended not to place executables in this directory that are
321           not useful for invocation from a shell; these should be placed in a
322           subdirectory of ~/.local/lib/ instead. Care should be taken when
323           placing architecture-dependent binaries in this place, which might
324           be problematic if the home directory is shared between multiple
325           hosts with different architectures.
326
327       ~/.local/lib/
328           Static, private vendor data that is compatible with all
329           architectures.
330
331       ~/.local/lib/arch-id/
332           Location for placing public dynamic libraries. The architecture
333           identifier to use is defined on Multiarch Architecture Specifiers
334           (Tuples)[6] list.
335
336       ~/.local/share/
337           Resources shared between multiple packages, such as fonts or
338           artwork. Usually, the precise location and format of files stored
339           below this directory is subject to specifications that ensure
340           interoperability. If an application finds $XDG_DATA_HOME set, it
341           should use the directory specified in it instead of this directory.
342

WRITE ACCESS

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

NODE TYPES

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

SYSTEM PACKAGES

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

USER PACKAGES

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

SEE ALSO

665       systemd(1), hier(7), systemd-path(1), systemd-gpt-auto-generator(8),
666       sysctl.d(5), tmpfiles.d(5), pkg-config(1), systemd.unit(5)
667

NOTES

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