I tested with this method in macOS 12.3.1 Monterey. This will list all sharing files.
This is modified from answer by @dvilchez here,
which no longer works in macOS 12.3.1 Monterey but the same principle works with modifications.
file be path to your file,
mdls "$file" will show you all the metadata of this file.
file is "Shared by Me", then we'll see
kMDItemIsShared = 1.
(This is the key step to discover which metadata key to use,
which may not be in older macOS, and may change in newer macOS.)
Hence, to search all files that is "Shared by Me", use
mdfind -onlyin "$HOME/Library/Mobile Documents/" 'kMDItemIsShared == 1'
"$HOME/Library/Mobile Documents/" is the root directory of your iCloud.
For any other folder,
- right click the folder,
- holding the
Copy "..." as Pathname,
mdfind -onlyin 'PASTE_YOUR_PATH_HERE' 'kMDItemIsShared == 1', remember to single quote your path as typically an iCloud path has spaces.
Original answer below:
Below is a non-robust and manual method to do this.
It has been working for me since the original answer on Dec 6, 2019.
I didn't document which macOS I was using, but from the date it is likely
macOS 10.15 Catalina or possibly macOS 10.14 Mojave.
Updated at Apr 14th, 2022 with macOS 12.3.1 Monterey.
- Go to the iCloud Drive folder you want to find shared files,
- search in this folder (by pressing
Cmd + F),
- make sure current directory is selected, not "This Mac", and
- search by
Shared by Me (quoted
"Shared by Me" would not work).
- Hopefully all documents "Shared by Me" is shown, per document,
- Confirm that it is "Shared by Me":
- For older macOS version, only in the enclosing folder you will be able to see the file is marked as "Shared by Me". Right click and click
Show in Enclosing Folder and check if the file is "Shared by Me".
- For later macOS (e.g. 12.3.1 Monterey), you can see "Shared by Me" at the end of the filename.
- Remove sharing:
- For older macOS version,
- right click on the "Shared by Me" file,
Share > Show People,
Share Options, choose
- for newer macOS version (e.g. 12.3.1 Monterey).,
Share > Manage Shared File,
This method is not robust as you won't know if there's any false negative. And with macOS 12.3.1 Monterey I'm getting a lot of false positive.