cd命令小技巧

(1)从任一目录回到用户的home目录:“cd”或“cd ~”。举例如下:

[root@localhost ~]# cd /home/iso/
[root@localhost iso]# pwd
/home/iso
[root@localhost iso]# cd
[root@localhost ~]# pwd
/root
[root@localhost ~]# cd /home/iso/
[root@localhost iso]# pwd
/home/iso
[root@localhost iso]# cd ~
[root@localhost ~]# pwd
/root

(2)回到之前的工作目录:“cd -”。举例如下:

[root@localhost ~]# pwd
/root
[root@localhost ~]# cd -
/home/iso
[root@localhost iso]# pwd
/home/iso

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.