Delete a hidden file

Hello everyone

I use Nextcloud 27 (on debian 11 server), and one of my users made a big mistake by uploading files in his space whose name starts with dot.

Of course, he no longer sees these files in his space and the system tells him that he has 3 hidden files he can’t delete.

I was thinking of simply deleting these files with an rm command in his space via an ssh connection on the nextcloud server, but it doesn’t seem to work.

What is the correct method, and command, as admin, to delete a file via ssh on user space on the nextcloud server?

Many thanks in advance

If you delete a file with e.g. console the Nextcloud database does not recognize it.

I think you must re-scan the files for the user.

sudo -u www-data php occ files:scan username

Thank you

I realized that I had to type the command rm “.xxxxx”, i.e. with the " for it to work.

Then I ran the command sudo -u www-data php occ files:scan --all

thank you for the command sudo -u www-data php occ files:scan username

I thought there might be a command like sudo -u www-data php occ files:remove /path/to/file