首页 > 其他 > 详细

pwd命令

时间:2015-07-08 20:52:34      阅读:209      评论:0      收藏:0      [点我收藏+]

【pwd】      打印当前的工作目录             pwd==print work director

命令格式:

pwd [OPTION]...

命令功能:

打印当前工作目录的全路径

命令参数:

-L, --logical               目录连接链接时,输出连接路径

-P, --physical            输出物理路径

命令实例:

实例1:查看当前路径

命令:

pwd

输出:

[root@localhost ~]# pwd

/root

实例2:目录连接链接时,pwd -P  显示出实际路径,而非使用连接(link)路径;pwd显示的是连接路径

命令:pwd -P

输出:

[root@localhost init.d]# pwd

/etc/init.d

[root@localhost init.d]# pwd -P

/etc/rc.d/init.d

[root@localhost init.d]# ll

lrwxrwxrwx.  1 root root     11 Jul  5 09:38 init.d -> rc.d/init.d

实例3:/bin/pwd

输出:

[root@localhost init.d]# /bin/pwd

/etc/rc.d/init.d

[root@localhost init.d]# /bin/pwd -P

/etc/rc.d/init.d

[root@localhost init.d]# /bin/pwd -L

/etc/init.d

实例4:当前目录被删除了,而pwd命令仍然显示那个目录,/bin/pwd不显示

命令:

pwd /bin/pwd

输出:

[root@localhost hello]# pwd

/nihao/hello   

[root@localhost hello]# /bin/pwd

/nihao/hello

[root@localhost hello]# rm -rf ../hello/

[root@localhost hello]# pwd

/nihao/hello

[root@localhost hello]# /bin/pwd

/bin/pwd: couldn‘t find directory entry in `..‘ with matching i-node

pwd命令

原文:http://www.cnblogs.com/topaz1618/p/4631223.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!