功能
切换工作目录语法
cd [dirname]示例
cd进入用户主目录
lychie@ubuntu:/setup/apache-tomcat-7.0.55$ cd
lychie@ubuntu:~$ pwd
/home/lychie
lychie@ubuntu:~$ pwd
/home/lychie
cd ~进入用户主目录
lychie@ubuntu:/setup/apache-tomcat-7.0.55$ cd ~
lychie@ubuntu:~$ pwd
/home/lychie
lychie@ubuntu:~$ pwd
/home/lychie
cd -返回进入此目录之前所在的目录
lychie@ubuntu:/setup/apache-tomcat-7.0.55$ cd
lychie@ubuntu:~$ cd -
/setup/apache-tomcat-7.0.55
lychie@ubuntu:/setup/apache-tomcat-7.0.55$
lychie@ubuntu:~$ cd -
/setup/apache-tomcat-7.0.55
lychie@ubuntu:/setup/apache-tomcat-7.0.55$
cd /进入系统根目录
lychie@ubuntu:~$ cd /
lychie@ubuntu:/$
lychie@ubuntu:/$
cd ..返回上一级目录
lychie@ubuntu:/setup/apache-tomcat-7.0.55$ cd ..
lychie@ubuntu:/setup$
lychie@ubuntu:/setup$