Linux 是一个多用户环境,因此每个用户也被分配一个特定的目录,该目录仅对他们和系统管理员可见。 这些是用户主目录,可以在 '/home/$USER' (~/) 下找到。 这是您的乐园:一切都在您的掌控之下,您可以编写文件、删除文件、安装程序等等...... 您的主目录包含您的个人配置文件,即所谓的点文件(它们的名称前面有一个点)。 个人配置文件通常是“隐藏”的,如果您想查看它们,您必须在文件管理器中打开相应的选项,或者运行带有 -a 开关的 ls 命令。 如果个人配置文件和系统范围的配置文件之间存在冲突,则以个人文件中的设置为准。
最终用户最有可能修改的点文件可能是您的 .xsession 和 .bashrc 文件。 分别是 X 和 Bash 的配置文件。 它们允许您更改登录时启动的窗口管理器,以及别名、用户指定的命令和环境变量。 几乎总是,当创建一个用户时,他们的点文件将从 /etc/skel 目录中获取,系统管理员在该目录中放置一个示例文件,用户可以随意修改。
/home 可能会变得非常大,并且可以用于存储下载内容、编译、安装和运行程序、您的邮件、您的图像或声音文件集合等等。
FSSTND 指出
/home is a fairly standard concept, but it is clearly a site-specific filesystem. 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 home directories. On small systems, each user's directory is typically one of the many subdirectories of /home such as /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. The setup will differ from host to host. Therefore, no program should rely on this location. If you want to find out a user's home directory, you should use the getpwent(3) library function rather than relying on /etc/passwd because user information may be stored remotely using systems such as NIS. 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. 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 intervention. |