Home directory
From Wikipedia, the free encyclopedia
This article does not cite any references or sources. (May 2008) Please help improve this article by adding citations to reliable sources. Unverifiable material may be challenged and removed. |
In computing, a home directory is a directory which contains the personal files of a particular user of the system.
Separating user data from system-wide data avoids redundancy and makes backups of important files relatively simple. Furthermore, Trojan horses, viruses and worms running under the user's name and with their privileges will in most cases only be able to alter the files in the user's home directory, and perhaps some files belonging to workgroups the user is a part of, but not actual system files.
[edit] Implementations
On Unix and Unix-like systems, a user's home directory contains all that user's documents and other personal data, including his configuration files of preferred settings for any software he has used there and might have tailored to his liking: web browser bookmarks, favorite desktop wallpaper and themes, passwords to any external services accessed via a given software, and so on. The user can also keep additional software which may not have been installed on the system as a whole. This directory will usually be organized with the use of sub-folders, at the user's preference.
The content of one's user home directory is private and can be made unavailable to other users of the system (local or remote), protected by a mechanism of file system permissions. Note however that anyone who has been granted superuser privilege, such as the system administrator, has authority to access any protected location on the filesystem.
The home directory is defined as part of the user's account data (for instance on Unix in the /etc/passwd file). It is where a user's focus is located upon login in a shell (as visible at the Command line interface prompt or via the "pwd" command).
The name of the home directory depends on the operating system, but there appears to be some convergence in recent years. In all cases "name" is the users name or id.
- /home/name - most distributions of Linux, most variants of BSD (e.g. OpenBSD), and Solaris
- /Users/name - Windows Vista, NeXTSTEP, OPENSTEP, Mac OS X, GoboLinux
- \WINNT\Profiles\name - Windows NT systems released in the 1990s (that is, prior to Windows 2000)
- \Documents and Settings\name - Windows 2000, Windows XP and Windows Server 2003
- /var/users/name, /u01/name, /usr/name, /user/name, /users/name - various Unix-derived systems
- /usr/name - original versions of AT&T Unix
On Windows the directories are always on the system drive, typically C:, so many of the above names can be prefixed with C: to make them not depend on the current drive. Conversely, not specifying the drive will allow the system drive to be different (perhaps D:). In addition, before Windows Vista, the name of the directory was localized into the language of the installed system. Thus the most reliable way to find the home directory was to expand the shell expansion %UserProfile% (and use relative naming from there to find other users).
On Unix-derived systems the home directory of the superuser does not follow the naming conventions of other users. Traditionally it was /, but on many newer systems it is located at /root (Linux, BSD), or /var/root (Mac OS X). The easiest way to find a home directory is to expand the Environment variable $HOME and use relative naming from there, but the official method is to parse the data out of the file /etc/passwd.
Single-user operating systems (which may be used by more than one person, but which are called "single-user" because they do not differentiate between different owners' files) typically do not have home directories, though they may have separate disks or partitions which may or may not be used for this purpose. For example, AmigaOS versions 2 and up have "System" and "Work" partitions on hard disks by default. The BeOS (and its successors) have a /home directory which contain the files belonging to the single user of the system. Early versions of Windows did not have the user name, and thus /MyDocuments was in effect the single users home directory. In NeXTSTEP and OPENSTEP in a single user, non-networked setup, /me is used, as well as /root when logged in as superuser.
An additional Unix naming convention (originating from the csh shell) is that ~user can be used as shorthand for referring to the home directory belonging to user, whatever its location on the filesystem. This is why many web servers are configured to show a user's personal website when a URL such as http://www.catb.org/~esr/ is accessed (in this example, the username is esr). A further shorthand allows a user to refer to his own home directory simply as ~ (the tilde character).
In the VMS operating system, a user's home directory is called the "root directory", and the equivalent of a Unix/DOS/Windows/AmigaOS "root directory" is referred to as the "Master File Directory".