

You may have difficulty deleting a file if it’s been locked. help remove dirt left on Terminal floor by 500,000 who pass, through station in an average day. If it’s a background process that’s using the file, open Activity Monitor and terminate the process. You will see a list of the applications and processes using the file in the Terminal window.Drag the file that’s in use from the Trash to the Terminal window.Now open Terminal and type lsof (followed by a space).Click on the Trash so that a Finder window opens up.If you want to try and identify which application is using the troublesome file, you could try the following Terminal Command: Something about theyre being used by some progam, which is simply not the case.
#FORCE EMPTY TRASH THRUGH TERMINAL PC#
Now you should be able to empty your trash and delete the file. Force empty trash (10.12.6) If I remember correctly this function was removed when El Capitan arrived and ever since Ive been having issues when trying to delete files that were used on a PC as well. If that doesn’t work, check to see if there is a startup item that is using the file, or just start up the Mac in Safe Mode – which will stop any Startup items running. After restarting Mac, launch the Terminal via spotlight and follow these steps to empty trash Mac: Enter sudo rm R (Do not hit enter and make sure you copy it correctly with the correct spaces) Press Control + click on the Trash icon to open Select all the files inside the Trash Drag all the files.In that case, try restarting your Mac then attempt to empty the trash. If that doesn’t work the app may still be using the file for a background process.You should now be able to empty the trash. Quit the app that you think might be using the file (or quit all open apps if you aren’t sure).Here are a few solutions to delete an “in use” file from the Trash:
