How can I reverse lookup an alias, ie. find what links to a folder?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 01-22-2024 04:39 AM
I am looking for a way to find all Aliases which link to the "OneDrive-MyCompany" folder in ~/Library/CloudStorage
When I use
mdfind -name "OneDrive-MyCompany"
It only finds the original folder but not the Alias which is in "$HOME".
mdfind "kMDItemKind == 'Alias'"
Does not show any output ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 05:18 AM - edited 01-22-2024 05:34 AM
@JevermannNG Short of examining every file within a directory to see if it's an alias and then resolving it to see what it points to I don't think you're going to find that information easily. There is no requirement an alias' name match the name of the file/folder it's pointing to, and there's no attribute on a file/folder that tracks any aliases that have been created for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 01-31-2024 07:45 AM
I am looking for a different way now, but using "find" does not list me the Alias of OneDrive which is located in $Home/
The following command line does not find the Alias in "$HOME/OneDrive - CompanyName"
sudo find $HOME/ -name "OneDrive - CompanyName" -depth +1 -print 2>&1 | grep -v "Operation not permitted"
Is there something wrong in the command line or is "find" not able to find "Finder Alias" ?
