Tip & How-To about Computers & Internet

Easy way to empty trash on a Mac when it tells your files are in use.

Ever try to empty your trash on your Mac and the system gives you an error telling you that a file in the trash can is in use and it will not allow you to get rid of it no matter what you try? Well, here's a little trick to help you get around this.

1. Open up terminal and type "sudo nano .bash_profile" and input your administrator password. This will allow you to view and edit this text file. We are going to use this to create an alias.

2. Click inside the terminal window to take control of an active cursor and use your arrow keys to move around. Type alias emptytrash='rm -rf ~/.Trash/*' into the window. Be sure to type the command exactly as shown otherwise you may end up deleting something you didn't intend to.

4. Press the "Control" key plus the "O" key to write the text out to the file and press enter to accept the default file name.

5. Press the "Control" key plus the "X" key to exit.

6. Close the terminal window.

Now any time you run into the issue of being unable to empty your trash due to stuck files, you can just open up terminal and type "emptytrash" and hit enter. Doing so will automatically run the 'rm -rf ~/.Trash/*' command and clean out your trash can for you, regardless of what is in there.

A video tutorial can be found here at the bottom of this tip.
I hope this helps!

Posted by on

Computers & Internet Logo

Related Topics:

Related Questions:

5 Answers

Is it possible to recover deleted files on Mac after emptied Trash?

Download and launch EaseUS Data Recovery Wizard for Mac on your Mac. Step 2. Select file types you want to recover and choose location where the Mac Trash bin is. All permanently deleted files will be found from the emptied Mac Trashbin.

Feb 03, 2018 | MAC Computers & Internet

2 Answers

how do I fix error code -8072 in OSX when trying to deleteitems fro Trash bin

If you can't empty the Trash on your Mac Try these solutions if you can't empty the Trash or move a file to the Trash.
If your Mac says that the file is in use
  1. Quit any app that you were using with the file, then empty the Trash.
  2. If that doesn't work, the app might have one or more background processes that are using the file. Restart your Mac, then empty the Trash.
  3. If that doesn't work, you might have a startup item or login item that is using the file. To temporarily prevent such items from opening automatically, start up in safe mode by holding down the Shift key while your Mac starts up. Then empty the Trash and restart your Mac normally.

If you can't delete the file for other reasons
  1. Start up from macOS Recovery by holding down Command-R while your Mac starts up.
  2. When the macOS Utilities window appears, select Disk Utility and click Continue.
  3. In Disk Utility, select the disk that contains the file that you want to delete. Then use the First Aid feature of Disk Utility to repair that disk.
  4. Quit Disk Utility, then restart your Mac and empty the Trash.

Jan 02, 2018 | Computers & Internet

2 Answers

what is mac error code-8003

If you are a Mac user then I know you have experienced this. You've been deleting files and your Trash Can is showing that there are items in it. You try to empty the trash and all of a sudden an error window appears. It probably looks something like this.
I share a link please visit and read it.

Apple Support

May 11, 2014 | Computers & Internet

3 Answers

deleted wrong bloggie videos trash is empty how to restore? using a MAC

Take a look at this article: How to Recover Files Deleted in Trash Mac.

Note: before recovery, do not put more items to the Macintosh HD where those trashed stuff originally located. Best regards.

Jun 03, 2011 | Computers & Internet

9 Answers

accidently emptied a trash bin that contained a very import ant file. How to restore this file?

1. If you simply put files in the Trash you can restore them by opening the Trash (left-click on the Trash icon) and drag the files from the Trash to your Desktop or other desired location.
2. "Time machine" is a built-in backup tool that works with your Mac and an external drive, As the problem you described, I read it. The files deleted in Trash bin could be a different problem which Time machine can't solve. you can read this article and learn more. I hope it will help.
3. If you don't have a Time Machine backup yet, then your best option would probably be uFlysoft Data Recovery for mac software

Mac File Recovery How to Recover Lost Files from Emptied Mac Trash

Mar 09, 2011 | Apple Computers & Internet

Not finding what you are looking for?

839 people viewed this tip

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18424 Answers

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

David Payne
David Payne

Level 3 Expert

14162 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions