1

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?

  • Try by booting your Mac into safe mode and check if you can delete the file from Trash there. – Nimesh Neema Aug 17 '18 at 7:51
  • I tried in safe mode also. It doesn't work – Abhimanyu Aryan Aug 17 '18 at 7:53
  • 1
    You might try running rm -fr .Trash/* from a terminal window (make sure you haven't cd'd out of your home directory first). 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. You might get an error message pointing to the underlying cause of the problem. Report it here if so. – Harald Hanche-Olsen Aug 17 '18 at 8:43
  • @HaraldHanche-Olsen add this to answer. It worked – Abhimanyu Aryan Aug 17 '18 at 8:51
  • 1
    Oh goodie! I added some detail in my answer. – Harald Hanche-Olsen Aug 17 '18 at 8:58
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .