How to Add a Delete Option to the Context Menu in Mac

If you are a Mac user, you will know that it doesn’t allows you to permanently delete files from the context menu. There is only an option “Move to Trash” that move your file to the trash and you have to manually empty the trash to delete the file. Wouldn’t it be great if you can add a “Delete” option in the context menu so you can quickly and easily delete the file/folder?

In terminal, we can easily delete (or remove) a file or folder with the command “rm“. Coupled with the “-rf” flag, we can get the system to forcefully delete a file or folder without prompt. In this tutorial, I will show you how you can make use of this command, together with Automator, to add a “Delete” option to the context menu.

1. Open Automator and select “Services”.


2. At the top of the right pane, select “files or folders” in “Finder”.


3. On the left most pane, select “Utilities” and drag the “Ask for Confirmation” option to the workflow. Enter the message to show up in the confirmation dialog.


4. Next, drag “Run Shell Script” to the workflow. Change the “Pass input” field to “as arguments”.


Paste the following lines into the shell script body:

5. Lastly, save the service with the name “Delete”.


That’s it. Now when you right click on any file or folder, you should see a “Delete” option. Select it and it will delete the file/folder.

Binding a shortcut key to Delete file

An additional thing that you can do with this newly created “Delete” service is to bind a keyboard shortcut to it. You can then press the shortcut key to quickly delete the file.

1. In Finder, go to “Finder -> Services -> Services Preferences” in the menu bar. Locate the “Delete” option, click on it and select “Add shortcut”.


2. Once you have set your shortcut key, you can press it after you have selected the file(s) and it will delete the selected file(s).


Damien Damien

Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.


  1. I like this a lot, and it has generally worked for me.

    BUT …. what I’m seeing when I right click on a file, is that the “Services” including the new “Delete” option are in a sub-menu at the bottom, so I have to go one level more to click on delete.

    Is there a way to expand this menu automagically so it looks like the screen shot in your tutorial?? (Maybe I have too many services .. there are 5 in the sub-menu list)

    1. Yes, it collapses when there are too many services. It happened to me too. One of the solution is to reduce the number of services.

  2. Thanks for this it runs, but generates an error when I run it, “The action “Run Shell Script” encountered an error.” any ideas.
    I copied and pasted the script in place of the one generated by automator.

Comments are closed.