Home  >  Article  >  Operation and Maintenance  >  What is the home directory of linux

What is the home directory of linux

WBOY
WBOYOriginal
2022-03-24 11:04:3513295browse

在linux中,主目录是用户的家目录,可以使用“~”来表示;在添加用户时可以指定主目录,不同的用户,主目录可能不同,可以使用“cd ~”命令返回到主目录中。

What is the home directory of linux

本教程操作环境:linux7.3系统、Dell G3电脑。

linux的主目录是什么

Linux主目录是用户的家目录,添加用户的时候指定的。对于不同用户,主目录不同。~ 表示Linux中的主目录,在终端中输入cd ~命令就能返回到主目录中,前提是有用户目录。

目录是Linux系统组织文件的一种特殊文件。

用户主目录是系统管理员增加用户时创建起来的(以后也可以改变),每个用户都有自己的主目录,不同用户的主目录一般互不相同。

用户刚登录到系统中时,其工作目录便是该用户主目录,通常与用户的登录名相同。

用户可以通过一个~字符来引用自己的主目录。

例如命令

/home/WANG\$ cat ~/class/software_1

和下面的命令

/home/WANG\$ cat /home/WANG/class/software_1

意义相同。Shell将用用户主目录名来替换~字符。目录层次创建好之后,用户就可以把有关的文件放到相应的目录中,从而实现对文件的组织。

相关推荐:《Linux视频教程

The above is the detailed content of What is the home directory of linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is gui under linuxNext article:What is gui under linux