/home
is a fairly standard concept, but it
is clearly a site-specific filesystem.
[6]
The setup will differ from host to host. Therefore, no program should
assume any specific location for a home directory, rather it
should query for it.
[7]
User specific configuration files for applications are stored in the user's home directory in a file that starts with the '.' character (a "dot file"). If an application needs to create more than one dot file then they should be placed in a subdirectory with a name starting with a '.' character, (a "dot directory"). In this case the configuration files should not start with the '.' character. [8]
A number of efforts have been made in the past to standardize the layout of home directories, including the XDG Base Directories specification [9] and the GLib conventions on user directory contents. [10] Additional efforts in this direction are possible in the future. To accomodate software which makes use of these specifications and conventions, distributions may create directory hierarchies which follow the specifications and conventions. Those directory hierarchies may be located underneath home directories.
[6] Different people prefer to place user accounts in a variety of places. This section describes only a suggested placement for user home directories; nevertheless we recommend that all FHS-compliant distributions use this as the default location for user home directories. Non-login accounts created for administrative purposes often have their home directories elsewhere.
On smaller systems, each user's home directory is typically implemented
as a subdirectory directly under /home
, for example
/home/smith
, /home/torvalds
,
/home/operator
, etc. On large systems
(especially when the /home
directories are shared
amongst many hosts using NFS) it is useful to subdivide user home
directories. Subdivision may be accomplished by using subdirectories
such as /home/staff
,
/home/guests
,
/home/students
, etc.
[7]
To find a user's home directory, use a library function such
as getpwent
,
getpwent_r
of
fgetpwent
rather than relying
on /etc/passwd
because user information may be
stored remotely using systems such as NIS.
[8] It is recommended that, apart from autosave and lock files, programs should refrain from creating non dot files or directories in a home directory without user consent.
[9] Found at http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html and http://www.freedesktop.org/wiki/Software/xdg-user-dirs.
[10] A description of GLib's conventions can be found in the documentation for GUserDirectory, at http://developer.gnome.org/glib/unstable/glib-Miscellaneous-Utility-Functions.html#GUserDirectory.