zoukankan      html  css  js  c++  java
  • Linux命令学习总结:cd命令

    命令简介:

        该命令用来切换当前目录。cd 是change directory 的缩写

    命令语法:


        cd [-L|-P] [dir]

    使用示例


    1:切换到当前目录的上一级目录

       1: [root@DB-Server sysconfig]# pwd
       2: /etc/sysconfig
       3: [root@DB-Server sysconfig]# cd ..
       4: [root@DB-Server etc]# pwd
       5: /etc

    2:切换到当前目录的上上两层目录

       1: [root@DB-Server etc]# cd sysconfig/ 
       2: [root@DB-Server sysconfig]# pwd 
       3: /etc/sysconfig 
       4: [root@DB-Server sysconfig]# cd ../.. 
       5: [root@DB-Server /]# pwd 
       6: /

    3:切换到用户的宿主目录

       1: [root@DB-Server sysconfig]# pwd
       2: /etc/sysconfig
       3: [root@DB-Server sysconfig]# cd ~
       4: [root@DB-Server ~]# pwd
       5: /root

    4:切换到根目录

       1: [root@DB-Server ~]# cd / 
       2: [root@DB-Server /]# 


    5:切换到某个目录,例如/etc/sysconfig/

       1: [root@DB-Server ~]# cd /etc/sysconfig/

    6: 返回进入当前目录前所在目录

       1: [root@DB-Server ~]# cd /etc/sysconfig/ 
       2: [root@DB-Server sysconfig]# cd - 
       3: /root
  • 相关阅读:
    统计单词Java
    信息反馈—冲刺08
    信息反馈—冲刺07
    PHP连接MySQL创建表
    phpstrom php出现404
    第十周总结
    信息反馈—冲刺06
    信息反馈—冲刺05
    无所心态,没环境下的自学
    centos6.5 nginx安装pcre错误
  • 原文地址:https://www.cnblogs.com/kerrycode/p/3425103.html
Copyright © 2011-2022 走看看