Linux relative paths absolute paths and special path characters

Relative paths, absolute paths and special path characters

1. Relative path absolute path

(1) Absolute path: Starting from the root directory of , it is a way of describing the path. The path description starts with /.

cd /home/zww/Desktop

Insert image description here

(2) Relative path: Starting from the current directory , it is a way of describing the path. The path description does not need to start with /.

cd Desktop

Insert image description here

2.Special path characters

Special path characters:

>  .表示当前目录,比如 cd ./Desktop 表示切换到当前目录下的Desktop目录内,和cd Desktop效果一致
>  ..表示上一级目录,比如:cd ..即可切换到上一级目录,cd ../.. 切换到上二级的目录
>  ~表示HOME目录,比: cd ~即可切换到HOME目录,或cd ~/Desktop,切换到HOME内的Desktop目录

Insert image description here

Guess you like

Origin blog.csdn.net/qq_43762434/article/details/134475502