简体   繁体   中英

How to find out if a folder is the target of a symlink on Mac OSX

I am trying to figure out if a folder is the target of a symlink and if so, where that source symlink is so that I can return the target folder to the original location. A Finder search for the same folder name does not give me any results. Usually I can find the source symlink with a search but sometimes it doesn't give me a result. Basically I have folders that I think are the targets of symlinks but I cannot remember where the actual source symlink is. I want to know this because this would've been the original location the folder was installed in before I moved it and made the symlink, and I want to return the destination folder to the original location. I was able to make the symlinks in Terminal but I am not knowledgeable about much else in terminal, so I would need step by step instructions if the solution is a Terminal function. thanks.

High Sierra 10.13

Just a simple ls -l in your shell ought to do the trick. See if you can figure out which of these lines represents a symlink and which represents an actual file/directory?

zsh截图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM