MacOS – Folders in trash won’t get deleted? Says they are “in use”

findermacosterminaltrash

Ok, I have tried even doing in terminal ~/Trash then rm -rf to clear it manually, and in my Finder preferences I have deselected the "give warning" when emptying trash icon.

My issue is I have these folders which I don't think actually contain anything, however when I was backing up another computer that I had connected I accidentally dragged all the important folders copied to the trash on this main computer – Applications, History, etc. Now they just sit in trash and when I put new things in trash, EVEN THOUGH I have the warnings off I get these dialogues from finder saying:

The operation can’t be completed because the item “folder's name” is in use.

or

Some items in the Trash cannot be deleted because of System Integrity Protection.

I just hit Continue and everything in Trash EXCEPT the folders gets deleted. How can I remove these folders? I need them off my computer – any other CLI commands to try?

EDIT: ls -l ~/.Trash returns nothing in terminal.

Best Answer

There can be multiple trash folders. There is a trash folder on your startup drive. This is the one you are referencing. There are other trash folder. There is a trash folder in each of your other partitions. When you drag something to the trash folder on another partition, it gets placed in the other partition's trash folder.

You look only on the startup drives trash folder. Since you have seen nothing in the startup drives trash folder, the folders to be deleted must be on some other partition.

You should look on your other computer. Notice the name of the trash on your startup drive is .Trash . Notice the name of the folder on your external drive is .Trashes .

https://discussions.apple.com/message/29843847#29843847

Sorting through these commands may provide clues. Notice that the files are placed in the 501 folder which is you uid.

mac $ cd .Trashes/
mac $ pwd
/Volumes/hps+/.Trashes
mac $ ls -l
ls: .: Permission denied
mac RC=1 $ sudo ls -l
total 0
drwx------@ 4 _unknown  _unknown  136 Dec 23 14:31 501
mac $ sudo ls -la
total 0
d-wx-wx-wt@ 3 _unknown  _unknown  102 Dec 23 14:31 .
drwxrwxr-x  9 root      wheel     374 Dec 23 14:31 ..
drwx------@ 4 _unknown  _unknown  136 Dec 23 14:31 501
mac $ cd 501
/Volumes/hps+/.Trashes/501
mac $ ls -la
total 16
drwx------@ 4 mac  staff   136B Dec 23 14:31 ./
d-wx-wx-wt  3 mac  staff   102B Dec 23 14:31 ../
-rw-r--r--@ 1 mac  staff   6.0K Dec 23 14:31 .DS_Store
-rw-r--r--  1 mac  staff     0B Dec 23 14:30 hi
mac $ pwd
/Volumes/hps+/.Trashes/501
mac $ ls -la
total 16
drwx------@ 4 mac  staff   136B Dec 23 14:31 ./
d-wx-wx-wt  3 mac  staff   102B Dec 23 14:31 ../
-rw-r--r--@ 1 mac  staff   6.0K Dec 23 14:31 .DS_Store
-rw-r--r--  1 mac  staff     0B Dec 23 14:30 hi
mac $