High Sierra – Can’t Empty Trash

high sierratrash

I was working on a Node.js and Express project. I installed a module for TypeScript in VSCode for intellisense. I subsequently deleted the project, but it compiled those modules in .compile in same project and now I'm not able to delete this directory from Trash. Neither am I able put the item back to its original location.

How do I get rid of the item from the Trash?

Best Answer

You might try running rm -fr .Trash/* from a terminal window.

Make sure you haven't cd'd out of your home directory first. But foremost, be careful: rm -fr is a powerful and dangerous command if used wrongly. For example, if you were to add a space before the *, you'd remove all of your files, including the .Trash directory! The first is disastrous, the latter is probably not desirable.

It still might not succeed, due to files with flags set. In case you run into such problems, note that the -O (capital letter O) flag to ls -l will display any file flags. Run, e.g., ls -AlOR .Trash to see a listing of everything in .Trash, including their flags. Check the manual page for chflags to learn what flags exist, what they mean, and how to change them.