macOS: Remove iCloud downloaded files from a folder (and sub-folders)

In case it helps anyone else… if you want to remove all iCloud downloaded files from a folder and sub-folder, the following will help:

The brctl command can download or un-download files. The evict sub-command un-downloads.

Finder is useless when it comes to removing downloads because it may show a file as not been downloaded but when you enter the folder you’ll find there may be some downloaded files. Doing it via find above just targets all files in the folder you are in.

If an iCloud file is not downloaded it starts with a period . and ends with .icloud. So you could also just target files matching *.icloud too.