码迷,mamicode.com
首页 > 其他好文 > 详细

2.7CD命令

时间:2018-03-12 21:22:31      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:cd命令   pwd命令   

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命令

标签:cd命令   pwd命令   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!