MacOS – Force removing items from Trash

catalinamacosterminaltrash

I deleted a user folder from Macintosh HD/Users that was inactive. It is now in the Trash and when I attempt to empty trash or delete immediately I am unable.

I used Terminal to navigate to:

cd ~/.Trash

then attempted the following three options:

rm -R name_of_folder
rm -rf name_of_folder
sudo rm -rf name_of_folder

None of these worked. Getting errors such as "not an empty directory" or "file is in use."

When I show invisible files in Finder using Shift + Command + . I can see that the user folder I deleted has an invisible "Library" folder inside with various subfolders inside of that.

I do not believe any of these files or folders are being used by the system as they are currently in the trash and no longer in the "Users" folder on my Macintosh HD.

How do I remove these files?

(I am running macOS Catalina public beta 8)

Best Answer

Welcome to Ask Different. This is something I encounter a lot. You should try these tricks from the finder. You can open the trash and ctrl-click the file you want to delete and select delete immediately. You can also try holdind down the option key while emptying trash. These methods were recommended by this reference, I don't know the corresponding terminal command if there is one.