• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

国民时代

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

Linux命令:pwd

 

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

-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.

 

本篇文章出自“国民时代”,转载请注明转载出处。

posted on 2019-03-30 14:38  国民时代  阅读(258)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3