How can I skip the Trash when deleting a file? I frequently connect different external USB hard drives and flash drives to my computer and I would like to facilitate deleting files and regaining disk space from them.

If I simply delete the file, it will be kept in a hidden trash folder on the external drive until I empty the Trash. This also forces me to empty my local trash simultaneously while the external disk is still connected to regain the disk space, which is undesirable.

At the moment, the only other "solution" I've found is moving the file to the internal hard drive and then trash it. This is not optimal because I waste time moving files from one drive to another (I regularly deal with 20GB+ VMs).

How can I permanently delete a file from an external drive, bypassing the trash?
You can create an Automator service or application to facilitate executing the rm shell commando, which will permanently delete files or folders and skip the trash.

For example, start with creating a new Service in Automator.app.


Select files or folders as input, you probably also want to limit the availability of this service to the Finder app.





Optionally, but highly recommended, first add an Ask for Confirmation step to the workflow.





Finally, add the Run Shell Script step to the workflow. Make sure to pass input as arguments. Then you can put in the following script:

for f in "$@"
do
    rm -rf "$f"
done





As mentioned by @Thecafremo, you can also add a -P parameter to rm for additional security while deleting. For an extra nicety, you can add some audible feedback by adding the following command at the end of the shell script:

afplay "/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/finder/empty trash.aif"


Save your service, and it should be ready to use in Finder from the Services menu in the menu bar. The service will also appear at the bottom of the menu you get by right clicking on files in Finder, although to make it appear there you may have to run it once from the Finder &gt; Services menu first.  You can also configure a keyboard shortcut to your service in the Keyboard preference pane of System Preferences.





Instead of creating a service, you could similarly create an application in Automator, which you can pin in the Dock so you can drag files to it.