cd 更改目录ide
一、单独一个命令是进入到用户的家目录ui
[root@wy ~]# cdspa
[root@wy ~]#it
等同于cd ~,~就表示root,即用户的家目录class
[root@wy ~]# cd ~di
[root@wy ~]# cd /tmpview
[root@wy tmp]# cd ~vi
[root@wy ~]#co
二、查看当前用户editor
[root@wy ~]# whoami
root
三、查看用户的uid或组
[root@wy ~]# id
uid=0(root) gid=0(root) groups=0(root)
四、查看用户的家目录
[root@wy ~]# echo $HOME
/root
五、如何查看当前在哪一个目录下
[root@wy ~]# pwd
/root
六、cd后面加上要进入的目录
[root@wy ~]# cd /tmp
[root@wy tmp]# pwd
/tmp
七、无论在哪一个目录下,用cd单独的命令,都会回到用户的家目录下
[root@wy tmp]# cd
[root@wy ~]# pwd
/root
八、回到上一次所在的目录(交替)
[root@wy ~]# cd -
/tmp
[root@wy tmp]#
[root@wy tmp]# cd -
/root
[root@wy ~]#
九、cd . 进入当前目录,cd .. 进入到上一级目录
[root@wy ~]# cd /tmp
[root@wy tmp]# cd .
[root@wy tmp]# cd /var/log
[root@wy log]# cd ..
[root@wy var]#
[root@wy var]# pwd
/var