本文共 769 字,大约阅读时间需要 2 分钟。
看到这个标题,是不是感觉有点绕?Linux 下的 cd (change directory)命令相信大家都用过,虽然不敢说是大家使用最多的命令,但至少算使用最多之一的了吧!
[root@master ruby_learning]# pwd/root/ruby_learning[root@master ruby_learning]# cd /usr/local/src/[root@master src]# pwd/usr/local/src[root@master src]# cd -/root/ruby_learning[root@master ruby_learning]# pwd/root/ruby_learning
如果是 root 用户,home 目录就是 /root, 如果不是 root 用户,home 目录就是 /home/<username> 目录
[root@master ruby_learning]# cd ~[root@master ~]# pwd/root[looking@master ruby_learning]$ pwd/home/looking/ruby_learning[looking@master ruby_learning]$ cd ~[looking@master ~]$ pwd/home/looking[looking@master ~]$
[root@master ruby_learning]# pwd/root/ruby_learning[root@master ruby_learning]# cd ..[root@master ~]# pwd/root
转载地址:http://icjqi.baihongyu.com/