I recently cleared my system caches and as usual moved them to trash and then clicked empty trash. After the cleanup I was designing some stuff when my eyes fell upon the trash icon, it was full inspite of the fact that I have recently cleared my trash, so I opened it and I came across this cache file (com.apple.kext.caches) no matter how many times I am clicking on empty trash, trash is not getting emptied it still shows full and the file still exits in the trash!
The permissions on this file doesn't allows me read/write this file so tried to add myself (admin) via the get info panel and as expected macOS didn't allowed me to change the permissions.
After trying everything to delete this file I though of putting it back in it's original place system>library>caches and guess a same file already exits so I didn't replaced it.
Moving the cache file out of the trash recreates or creates an exact copy of the file within the trash.
Trash is working normal it is deleting everything send to it except the cache file!
And since it's a root file none of the DIY Terminal commands are working to remove the file
I have already tried deleting it in Safe mode, which didn't worked and I haven't yet tried deleting it in recovery mode using terminal because I don't know how to do it!
The message I am getting when I tried to delete the file using a terminal command:
Sayans-iMac:.Trash sayan$ sudo rm -R /Users/sayan/.Trash/com.apple.kext.caches
override rw-r--r-- root/wheel restricted for /Users/sayan/.Trash/com.apple.kext.caches/Directories/Library/Extensions/KextIdentifiers.plist.gz? Y
rm: /Users/sayan/.Trash/com.apple.kext.caches/Directories/Library/Extensions/KextIdentifiers.plist.gz: Operation not permitted
override rwxr-xr-x root/wheel restricted for /Users/sayan/.Trash/com.apple.kext.caches/Directories/Library/Extensions?
The file can be found under this directory
And I am getting this error when I am trying to delete the cache file using this command rm -rf path to the file.
ls
to determine whether your trash contains user trash, boot volume trash or trash from other/Volumes
as shown here