首页 > 其他 > 详细

2.7CD命令

时间:2018-03-12 20:50:42      阅读:223      评论:0      收藏:0      [点我收藏+]
2.7CD命令
cd 是change directory 目录的意思
cd -相互交互 回到上回目录 再输入又回到刚才目录

[root@localhost ~]# cd /etc/sysconfig/
[root@localhost sysconfig]# cd -
/root
[root@localhost ~]# cd -
/etc/sysconfig
[root@localhost sysconfig]# pwd
/etc/sysconfig
[root@localhost sysconfig]# cd -
/root
[root@localhost ~]# pwd
/root
[root@localhost ~]# cd -
/etc/sysconfig

cd 只输入cd回到架目录下 回到root下

[root@localhost sysconfig]# cd
[root@localhost ~]# pwd
/root

cd ~ 波浪号就相当于架目录 就相当于root

[root@localhost ~]# cd /etc/sysconfig/
[root@localhost sysconfig]# cd ~
[root@localhost ~]# pwd
/root

cd .. 回到上级目录 最顶尖的目录就是根 比如cd /1/2/3/ 回到2 回到1 回到根
最终回到根目录

[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@localhost network-scripts]# cd ..
[root@localhost sysconfig]# pwd
/etc/sysconfig
[root@localhost sysconfig]# cd ..
[root@localhost etc]# pwd
/etc
[root@localhost etc]# cd ..
[root@localhost /]# pwd
/

总结
cd 后面跟路径会到达指定的目录下
pwd 查看当前所在的路径 所在的目录文件夹
cd - 相互交互 回到上回目录 再输入又回到刚才目录
cd 只输入cd回到架目录下 回到root下
cd ~ 波浪号就相当于架目录 就相当于root
cd .. 回到上级目录 最顶尖的目录就是根

2.7CD命令

原文:http://blog.51cto.com/13038669/2085760

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!