Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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 ?

share|improve this question
    
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 '13 at 20:55
    
@bmike That could be a question for the site. I'll do some research.... –  Simon Sep 27 '13 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 '13 at 15:22

2 Answers 2

up vote 8 down vote accepted
+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

share|improve this answer
1  
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. –  Danijel J Sep 28 '13 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 –  Danijel J Sep 28 '13 at 11:21
    
Looks promising. Thanks very much for that detailed explanation. –  Simon Sep 28 '13 at 19:10
    
Just fixed up the code. Was missing for f in "$@" at the start of it. –  Danijel J Oct 1 '13 at 11:51
    
Appreciate the thoroughness of your answer. –  Simon Oct 1 '13 at 11:53

There is a service called Delete Immediately

(through http://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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.