You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Can't Delete a Folder from Trash

I have a folder in my trash. I have tried everything I can think of to remove it - no dice.


It is a folder - with nothing in it. css is the name of the folder.


ls -ale shows:


drwx------@ 4 myuser staff  128 20 Nov 18:27 .

 0: group:everyone deny delete

drwxr-x---+ 25 myuser staff  800 20 Sep 15:37 ..

 0: group:everyone deny delete

-rw-r--r--@ 1 myuser staff 10244 20 Nov 18:27 .DS_Store

drwxrwxrwx  4 root       wheel  128 20 Nov 08:33 css


1) Boot in safe mode - can't delete.

2) Boot in recovery mode - use terminal command to delete - permission denied.

3) Use this command: xattr -rc /Users/myuser/.Trash/css

in an attempt to remove: 0: group:everyone deny delete - no change - permission denied.

4) sudo rm -rf /Users/myuser/.Trash/css - "file is in use"... - permission denied.

5) chmod 777 - no dice - permission denied

6) Turned off System Integrity Protection - permission denied


I have tried and tried... HOW do I get rid of 0: group:everyone deny delete - I know that is preventing this from removal - but how do I remove this roadblock? I can't find how to get rid of it....


It's a folder I downloaded from OneDrive and it failed. I'd say it did... lol...


Any help much appreciated. I can't delete it.




MacBook Pro (2017 – 2020)

Posted on Nov 20, 2024 2:44 PM

Reply
4 replies

Nov 20, 2024 3:04 PM in response to scarygary

First the directory is not empty. There is a .DS_Store file in it. That has to go.


But the biggest reason you cannot delete it is because it has an ACL (access control list) entry that denies the ability to delete the file.


man chmod

and read the "ACL MANIPULATION OPTIONS" section.


Also just to be sure, check if there are any flags on the file

/bin/ls -dleO@ /path/to/the/directory

If there are, then look at

man chflags

Nov 20, 2024 4:07 PM in response to BobHarris

I am aware of the ACL - which is why I attempted this command:

xattr -rc /Users/myuser/.Trash/css


The above command should have removed the ACL on the folder.


The issue is:

0: group:everyone deny delete


It does not get removed when I try and remove the ACL. This issue is 100% new to me - I have no idea how to resolve it.


CHMOD 777 on the directory is wide open... I still can not delete it. I need to somehow remove:

0: group:everyone deny delete


No flags on the folder...


Ugh...




Nov 20, 2024 5:04 PM in response to BobHarris

chmod -N /Users/myuser/.Trash/css - no impact - acl remains.


chmod -a# 0 /Users/myuser/.Trash/css 

chmod: No ACL present '/Users/myuser/.Trash/css'


ls - lae:


drwx------@ 3 myuser staff  96 20 Nov 20:36 .

 0: group:everyone deny delete

drwxr-x---+ 25 myuser staff 800 20 Sep 15:37 ..

 0: group:everyone deny delete

drwxrwxrwx  4 myuser staff 128 20 Nov 08:33 css



Can't Delete a Folder from Trash

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