首页 > 系统服务 > 详细

Linux命令:pwd

时间:2019-03-30 14:54:52      阅读:210      评论:0      收藏:0      [点我收藏+]

 

打印当前目录的完全路径。

-L  打印路径包含符合路径

-P  打印路径不含符合路径。

-LP,可能打印的不同,取决于你对进入当前目录的方式是通过符号链接进入,还是物理目录进入。如果是符号链接进入,则-L和不带-L打印的一样,和-P的不一样;如果是从物理目录进入的,则所有情况打印的都一样。

换言之,要判断自己是否通过符号链接进入的,或者什么符号链接进入的,可以用pwd -L和pwd -P的打印进行比较来确定。

help pwd

 1 pwd: pwd [-LP]
 2     Print the name of the current working directory.
 3 
 4     Options:
 5       -L        print the value of $PWD if it names the current working
 6         directory
 7       -P        print the physical directory, without any symbolic links
 8 
 9     By default, `pwd behaves as if `-L were specified.
10 
11     Exit Status:
12     Returns 0 unless an invalid option is given or the current directory
13     cannot be read.

 

Linux命令:pwd

原文:https://www.cnblogs.com/ChinaGo/p/10627264.html

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