[Solved] Nextcloud Box file lock won't clear

I have a folder that I can not delete because it is locked. How do I clear a lock on a file or folder?

If you direct me to run a command such as “sudo -u www-data php occ files:scan --all” which was suggested in one post and worked for some but not all people, could you please let me know how to find the correct directory to run this command? I can’t remember how I managed to find the real root directory for nextcloud the last time I looked for it ages ago.

I checked the folders that were giving errors on attempted deletion. They now can be deleted.

Not sure if this means the problem was time dependent, or removing the problem folder from those synced with all clients allowed the system to clear itself.

While the problem lasted it was very annoying. All clients kept throwing up red error messages.