Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

sudo: /rm-r: command not found

I have three folders in my trash that will not delete. "The operation cannot be completed because 'name of my folder' is in use."


I tried in Safe Mode, as well as use Delete Immediately, all with no change.


Lastly I tried in terminal by running sudo: /rm-r and dragging one of the folders into terminal. I hit Enter and get


sudo: /rm-r: command not found


in my /bin file i do see rm so I try sudo: /bin/rm-r and still get


sudo: /bin/rm-r: command not found


I'm concerned that there is now a bigger issue than just the folders not being able to be deleted if I can't run rm.


Any ideas?

Posted on Feb 15, 2020 2:01 PM

Reply

Similar questions

12 replies

Feb 15, 2020 2:59 PM in response to MadcapLaughs79

I think you are flirting with danger using terminal in this way without more knowledge— i do not see a full path to your file or folder and is a good way to rm the entirety of the directory with catastrophic results.


I will say from what I see above the command line has several errors.



"I have three folders in my trash that will not delete. "


Where did these folders come from would be a clue to your issue and the way forward.

Feb 15, 2020 4:25 PM in response to MadcapLaughs79

You’re likely going to need to use xattr and/or chmod commands to remove the no-delete settings on those files.


You should not need sudo, nor would i recommend that here. Mistakes with sudo rm -r are whole lot less hazardous to macOS on Catalina, but it can still nuke all your files. Note the spaces. Those are very important.


Here are three harmless commands that’ll show the file settings, and the last will show your id and whether that’s.the same as the owner of the semi-trashed files. Post the output of the three. You might need to edit the filename, and maybe also the ids, but if you do edit those please do those edits consistently.


ls -aled@ ”/path/to/file”
ls -ale@ ”/path/to/file”
id


The quotes shown above are forum-preferred quote characters, and those won’t work directly. You’ll need to use the vertical double quote character, and not the angled double quotes.

Feb 15, 2020 6:57 PM in response to MrHoffman

Thank you. Here are the results using one of the folders (calendars):


absllc:~ ben$ ls -aled@ "/Users/ben/Calendars" 

drwxr-xr-x@ 3 ben  staff  96 Jan 26 23:42 /Users/ben/Calendars

com.apple.trash.put-back.icloud-parent-id#PS 37 

com.apple.trash.put-back.path#PS 18 


absllc:~ ben$ ls -ale@ "/Users/ben/Calendars" 

total 0

drwxr-xr-x@  3 ben  staff    96 Jan 26 23:42 .

com.apple.trash.put-back.icloud-parent-id#PS   37 

com.apple.trash.put-back.path#PS   18 

drwxr-xr-x@ 44 ben  staff  1408 Feb 15 18:48 ..

com.apple.metadata:_kTimeMachineNewestSnapshot   50 

com.apple.metadata:_kTimeMachineOldestSnapshot   50 

0: group:everyone deny delete


absllc:~ ben$ id

uid=502(ben) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),717(com.apple.sharepoint.group.17),715(com.apple.sharepoint.group.15),705(com.apple.sharepoint.group.5),713(com.apple.sharepoint.group.13),503(com.apple.local.ard_manage),711(com.apple.sharepoint.group.11),500(com.apple.local.ard_admin),707(com.apple.sharepoint.group.7),716(com.apple.sharepoint.group.16),709(com.apple.sharepoint.group.9),712(com.apple.sharepoint.group.12),704(com.apple.sharepoint.group.4),501(com.apple.local.ard_reports),708(com.apple.sharepoint.group.8),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae),702(com.apple.sharepoint.group.2),701(com.apple.sharepoint.group.1),502(com.apple.local.ard_interact),706(com.apple.sharepoint.group.6),710(com.apple.sharepoint.group.10),714(com.apple.sharepoint.group.14),703(com.apple.sharepoint.group.3)

Feb 15, 2020 9:48 PM in response to MrHoffman

I turned off iCloud, restarted, deleted the three folders which moved them to Trash and then ran the three commands you provided earlier and got this:


absllc:~ ben$ ls -alde@ /Users/ben/.Trash/Calendars /Users/ben/.Trash/com.apple.news /Users/ben/.Trash/News  

drwxr-xr-x@ 3 ben  staff   96 Jan 26 23:42 /Users/ben/.Trash/Calendars

com.apple.macl 72 

com.apple.trash.put-back.icloud-parent-id#PS 37 

com.apple.trash.put-back.path#PS 18 


drwxr-xr-x@ 4 ben  staff  128 Jan 27 00:13 /Users/ben/.Trash/News

com.apple.macl 72 

com.apple.trash.put-back.icloud-parent-id#PS 37 

com.apple.trash.put-back.path#PS 13 


drwx------@ 3 ben  staff   96 Jan 26 23:41 /Users/ben/.Trash/com.apple.news

com.apple.macl 72 


absllc:~ ben$ ls -ale@ /Users/ben/.Trash/Calendars /Users/ben/.Trash/com.apple.news /Users/ben/.Trash/News  

/Users/ben/.Trash/Calendars:

total 0

drwxr-xr-x@ 3 ben  staff   96 Jan 26 23:42 .

com.apple.macl 72 

com.apple.trash.put-back.icloud-parent-id#PS 37 

com.apple.trash.put-back.path#PS 18 

drwx------  5 ben  staff  160 Feb 15 21:39 ..


/Users/ben/.Trash/News:

total 0

drwxr-xr-x@ 4 ben  staff  128 Jan 27 00:13 .

com.apple.macl 72 

com.apple.trash.put-back.icloud-parent-id#PS 37 

com.apple.trash.put-back.path#PS 13 

drwx------  5 ben  staff  160 Feb 15 21:39 ..


/Users/ben/.Trash/com.apple.news:

total 0

drwx------@  3 ben  staff   96 Jan 26 23:41 .

com.apple.macl 72 

drwx------   5 ben  staff  160 Feb 15 21:39 ..

drwx------@ 11 ben  staff  352 Jan 26 23:41 Data

com.apple.macl 72 


absllc:~ ben$ id

uid=502(ben) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),717(com.apple.sharepoint.group.17),715(com.apple.sharepoint.group.15),705(com.apple.sharepoint.group.5),713(com.apple.sharepoint.group.13),503(com.apple.local.ard_manage),711(com.apple.sharepoint.group.11),500(com.apple.local.ard_admin),707(com.apple.sharepoint.group.7),716(com.apple.sharepoint.group.16),709(com.apple.sharepoint.group.9),712(com.apple.sharepoint.group.12),704(com.apple.sharepoint.group.4),501(com.apple.local.ard_reports),708(com.apple.sharepoint.group.8),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae),702(com.apple.sharepoint.group.2),701(com.apple.sharepoint.group.1),502(com.apple.local.ard_interact),706(com.apple.sharepoint.group.6),710(com.apple.sharepoint.group.10),714(com.apple.sharepoint.group.14),703(com.apple.sharepoint.group.3)


Feb 16, 2020 9:19 AM in response to MadcapLaughs79

I suspect you’ve gotten tangled with Catalina integrity protections, but have no proof of that.


The directories are deletable per the permissions, and there are none of the old no-delete attributes here, which implies it’s the com.apple.macl getting involved (or whatever caused the problem with the corruption that seemingly started this whole project), and that attribute is... under-documented.


I’d boot from Recovery and try a repair. Past that....? A call to Apple Support if you have that access, or off-loading and re-loading this user. Or reinstalling and migrating the content over. I’m hesitant to suggest deleting that entry, as I don’t know if that’ll have adverse effects elsewhere.


I find the com.apple.macl stuff murky, based on what little has become available outside of Apple.

sudo: /rm-r: command not found

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