I accidentally downloaded malware: something posing as Flash Player in flashplayer.dmg. I did not install it, but deleted the dmg file. Now I want to delete my trash bin, but I can't. It says: 'trash can't be emptied, flash player.dmg is in use.' How do I fix this?
rm .Trash/flash_player.dmgand press Enter. This removes the file.
- check whether the file is gone from the Trashcan
It might be helpful to run a malware cleaner afterwards as well to make sure nothing else got infected.
First, reboot. Second hold down the Option while selecting Empty Trash from the Finder menu.
Failing that boot in Safe Mode (hold the Shift key while booting your Mac). And try emptying the trash again.
Failing that you may want to try a free malware cleaner.