Linux基础命令- cd
- 作用:切换目录 语法:cd 目录名
- cd ~ #回到当前用户的宿主(家)目录
- cd … #表示返回到上级目录位置,也就是父目录
- cd . #表示进入到当前目录
- cd - #表示返回切换前的目录
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cd #回到当前用户的宿主(家)目录
[root@localhost ~]# cd ~ #回到当前用户的宿主(家)目录
[root@localhost ~]# pwd #显示当前工作目录的路径
/root
[root@localhost ~]# cd .. #表示返回到上级目录位置,也就是父目录
[root@localhost /]# pwd
/
[root@localhost /]# cd . #表示进入到当前目录
[root@localhost /]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# cd - #表示返回切换前的目录