12

In Windows it is possible to permanently delete a file or folder from the right click contextual menu. The right click contextual menu in OS X, does not by default give the option to delete a file or folder in this way, only the option to "Move to Trash", which means you then have to empty the trash manually in order to delete the file or folder.

Is it therefore possible to add this option to the contextual menu, to aid quick deletion ?

4
  • Let's for a minute suppose this was possible to accomplish (which since it's software is certainly possible). What would you have happen if you deleted a user home folder or /System?
    – bmike
    Sep 26, 2013 at 20:55
  • @bmike That could be a question for the site. I'll do some research....
    – Simon
    Sep 27, 2013 at 10:40
  • @bmike Firstly would OS X allow the deletion of these....surely its far too dangerous !! (I'm assuming a safe guard mechanism is in place to prevent this). Secondly in terms of the System folder, this would only be deleted if a new one was created following an archive & install of OS X ?
    – Simon
    Sep 27, 2013 at 15:22
  • Why not just use the built-in keyboard shortcut for this?
    – Wildcard
    Sep 26, 2016 at 10:41

4 Answers 4

17
+100

The simplest way is to create your own Service and call it whatever you want to name it.

I created a service simply called Delete Now and put it in my context menu like I have done here:

enter image description here

Make Your Own Delete Service

  1. Open up Automator (/Applications/Utilities/Automator) and create a new Service
    enter image description here
  2. At the top right pane, select files or folders in Finder
    enter image description here
  3. On the left most pane, select Utilities and drag the Run Shell Script option to the workflow
    enter image description here
  4. Change the "Pass input" field to arguments
    enter image description here
  5. Pase the following into the shell script body
for f in "$@"
do
rm -rf "$f"
done
afplay "/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/finder/empty trash.aif"  

6. Click File > Save on the menubar and give you service a name. Whatever you name it, is what it will be called

enter image description here

This will enable it immediately on your system. If you ever decide you don't want it, and need to replace this item, navigate to ~/Library/Services/ and you will see a list of folders called {servicename}.workflow. To remove the one you don't want, just delete it then in Terminal type

killall Finder

This will restart the Finder and remove it from the context menu straight away. Otherwise, it will clear up on next restart.


Add Keyboard Shortcut

To make a keyboard shortcut for the Service you created, follow these steps:

  1. From the Desktop, click the word Finder in the top left hand corner of the screen, then go to Services > Services Preferences enter image description here
  2. Scroll down the list on the right until you find the service you created by name. In this example, you can see Delete All that I made earlier. Highlight it, and click on add shortcut. enter image description here
  3. This will bring up a box. Make sure your mouse cursor is in there and depress the keys that you want to use to set the shortcut. In my example, I have used the combination Control+Shift+L. enter image description here
  4. Press Show All to save your settings.

Keyboard Symbols

To help anyone new to Apple keyboard symbols, here they are as follows:

^ = Control
= Shift
= Command
= Alt/Option

11
  • 2
    If you wanted to add a warning to the "Delete Now" function that I had created, before you drag the "Run Shell Script" option into the workflow, drag the "Ask for Confirmation" option at the top of the second column to the main working area, and edit the prompt. This will give you a two-step option in case you click it by accident. Sep 28, 2013 at 7:35
  • This is the image when you add the confirmation dialog. You can change it as need to: i.imgur.com/zciyUNw.png Sep 28, 2013 at 11:21
  • Looks promising. Thanks very much for that detailed explanation.
    – Simon
    Sep 28, 2013 at 19:10
  • Just fixed up the code. Was missing for f in "$@" at the start of it. Oct 1, 2013 at 11:51
  • Appreciate the thoroughness of your answer.
    – Simon
    Oct 1, 2013 at 11:53
4

There is a service called Delete Immediately

(through https://superuser.com/questions/10676/permanently-deleting-files-on-mac-os)

or you can make your own with Automator by means of the rm shell command.

Check also here.

2

I'm surprised it's not mentioned here, but there is a keyboard shortcut for this already.

It's option-command-delete.

This works on El Capitan. I'm not sure which version of OS X it was added in.


This shortcut works from anywhere in Finder (which is what this question is about), and also from inside the Trash (which is where I got the answer).

1
  • As far as I can remember, it seems to me this shortcut has been there like forever in OSX. Feb 21, 2020 at 0:18
-2

Windows simply says delete but that's not what it does. Every time you "delete" something you are actually moving it to the recycle folder. There are only a few circumstances when a folder will not be sent to the recycle bin they are as follows.

1 When you close out of something without saving and it hasn't been autosaved or saved before. 2 If you cut an item then cut another item therefore over riding the cache. 3 If the folder is a temporary file.

The nice thing about windows though is that you can let the recycle bin build up without looking at an icon of a whole bunch of trash. I've got a terabyte hard drive I don't have to clear it ever 10 items I delete.

1
  • 1
    Shift-Delete on a Windows computer doesn't move the file to the Recycle Bin. It deletes it.
    – Wildcard
    Sep 26, 2016 at 10:40

You must log in to answer this question.

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