~
represents the home directory, which is the user directory of the currently logged in user.
For example: My logged-in user is chen
cd ~
Video tutorial recommendation: linux video tutorial
~ represents /home/chen /. Of course, the premise is that there is a user directory. If there is no /home/chen directory, the situation will be more complicated.
/
refers to the root directory: the top-level directory of all directories.
./
represents the current directory. ./ generally needs to be used in conjunction with other folders or files to refer to things in the current directory.
cd . 没有太多意义 cd ./文件夹 切换到当前目录的某个文件夹
..
indicates the superior directory
cd .. 切换到上级目录 cd ../文件夹 切换到上级目录中的某个文件夹
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of What do '~', '/' and './' in Linux represent?. For more information, please follow other related articles on the PHP Chinese website!