..在目录地址中如何工作?

问题描述 投票:-1回答:1

我将..解释为以前的目录,所以我希望/ == /home/..。我尝试过:

  1. ls -a /
  2. ls -a /home/..

并且期待着相同的结果。但是结果有所不同。

我在做什么错?

“结果图像”

ls -a /home/..的结果:

  • ..
  • 。DS_Store
  • 。DocumentRevisions-V100
  • 。OSInstallerMessages
  • 。Spotlight-V100
  • 。TempReceipt.bom
  • 。TemporaryItems
  • 。file
  • 。fseventsd
  • 。installer-compatibility
  • 。vol
  • 应用程序
  • 图书馆
  • 系统
  • 用户
  • 音量
  • 核心
  • home
  • mnt
  • opt
  • 私人
  • usr

ls -a /的结果:

  • ..
  • 。file
  • 。fseventsd
  • 。DS_Store
  • 。Volumeicon.icns
  • 。vol
  • 应用程序
  • 音量
  • sbin
  • 图书馆
  • bin
  • home
  • tmp
  • 系统
  • 核心
  • opt
  • usr
  • 用户
  • dev
  • 私人
  • var
macos ls
1个回答
0
投票

/home是符号链接。在10.15系统上,它是/System/Volumes/Data/home的符号链接,因此/home/../System/Volumes/Data

© www.soinside.com 2019 - 2024. All rights reserved.