dot_clean won't work "Bad Pathname: Operation not permitted Failed trying to change dir to .Trashes"

Hi,


I'm trying to clean dot folders on my usb stick but keep getting the error message in the thread whenever I run dot_clean. The outcome is as below:


dot_clean -mn /Volumes/"my usb stick"

Failed trying to change dir to .Spotlight-V100

Bad Pathname: Operation not permitted

Failed trying to change dir to .Trashes

Bad Pathname: Operation not permitted


7582220 this solution also does not work for me.


Any suggestions?


Best


eren

Posted on Jun 29, 2022 11:20 AM

Reply
8 replies

Jul 1, 2022 11:20 AM in response to ueren

Which ones? There’s a couple things going on here and your answers are too vague figure out what the exact problem may be.

If you are trying to remove the Spotlight and Trash directories with dot_clean, it won’t work.

You could put together a Automator Quick Action that would remove those directories and run dot_clean to purge the metadata, but I think it might need admin privileges to remove Spotlight and Trash.

Jun 29, 2022 5:46 PM in response to ueren

Either put the whole path in quotes or escape the spaces

"/Volumes/my usb stick"
/Volumes/my\ usb\ stick


Easier, enter the command an leave a space, then drag the volume into the Terminal window:

dot_clean -mn 


If "my usb stick" has a .Trashes and a .Spotlight-v100, then there should be no need to clean it of extra metadata. The file system on the drive supports "embedded" metadata since it supports Spotlight.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

dot_clean won't work "Bad Pathname: Operation not permitted Failed trying to change dir to .Trashes"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.