cd命令

  • 概述
    切换工做目录
  • 选项
    Cd:切换回家目录
    Cd ~:切换回本身的家目录
    Cd~USERNAME:切换至指定用户的家目录
    Cd -:在上一次所在目录与当前目录之间来回切换
    注意:bash中,~表示家目录bash

  • 实例
    [root@localhost ~]# cd /etc/
    [root@localhost etc]# cd -
    /root
    [root@localhost ~]# cd -
    /etc
    [root@localhost etc]#
    [root@localhost ~]# cd ~tom
    [root@localhost tom]# pwd
    /home/tom
    [root@localhost tom]# cd ~
    [root@localhost ~]# pwd
    /root
相关文章
相关标签/搜索