I would like to delete and permanently delete a file in finder using del and shift+delete (windows style).

Is there any way to remap this in OS X lion?

  • 2
    Why? What is wrong with command-delete? – Abhi Beckert Mar 24 '12 at 9:56
  • 1
    See this question SU. You can also always use the terminal and rm. – Linuxios Aug 13 '13 at 16:57
  • @Linuxios Very good find :) – Simon Aug 13 '13 at 17:01
  • Sure. SU usually has better answers for these power user questions than the "consumer" oriented sites (Ask Different, Ask Ubuntu, etc.). – Linuxios Aug 13 '13 at 17:03
  • 1
    SU is for anything more power user than end user. Ask Different hovers between consumer and power user. – Linuxios Aug 13 '13 at 17:05

If you want to delete files immediately, you can copy the files, open Terminal or iTerm, type rm -r ‌ and press ⌘V.

If you want to delete the files securely so that they cannot be recovered with an application like DiskWarrior or DataRescue, you can use srm -srf. srm uses the 35-pass Gutmann algorithm by default, but -s only overwrites files with a single pass of random data.

You could also create a service like this:

osascript -e 'on run argv
    set text item delimiters to linefeed
    tell application "Finder"
        display dialog "Delete the following files immediately?" & linefeed & linefeed & text items of argv
    end tell
end run' "$@"
[[ $? != 0 ]] && exit 0
rm -rf "$@"

I didn't use an Ask for Confirmation action, because it can't be used to display the paths specified as arguments, and the dialogs shown by it don't get keyboard focus.

The service cannot be used to delete a file if deleting it would require superuser privileges.

You can give the service a keyboard shortcut from System Preferences > Keyboard > Keyboard Shortcuts > Services. The shortcut recorders don't allow entering ⇧⌦ as a keyboard shortcut, but you can first give the service some temporary shortcut, then close the System Preferences window, then run something like f=~/Library/Preferences/pbs.plist; plutil -convert xml1 $f; open -e $f, and then change the key equivalent to $:

<key>(null) - Delete Immediately - runWorkflowAsService</key>

$&#x007F; is ⇧⌦ (where ⌦ is Mac forward delete / Windows delete). ⇧⌫ would be $&#x0008; (where ⌫ is Mac delete / Windows backspace). The format used for the shortcut strings is described in http://lri.me/keybindings.html.

As for making ⌦ (Mac forward delete / Windows delete) move files to the trash, you can modify Finder's property list:

defaults write com.apple.finder NSUserKeyEquivalents -dict 'Move to Trash' '\U007F'
killall Finder

However that also makes pressing ⌦ move a file to the trash when you are renaming a file.

  • If only your answer would only consist of that last sentence ;-) – Asmus Mar 24 '12 at 11:08
  • after reading the last line ... this approach is almost useless unless we have a workaround for using delete in renaming the file – Riyaz Mohammed Ibrahim Mar 26 '12 at 4:46

If a two-step keyboard process is acceptable, you could always do:

+ to move the file to the Trash


+ + to empty the Trash (with confirmation popup) or

+ + + to empty the Trash (without confirmation popup).

Obviously, that will also get rid of all the other files already in the trash.

Alternatively, maybe something like Trash X would help. The description says:

You can use it to instantly delete or shred file and folders without sending them to the trash. You can use it to empty or shred trash only on selected disks. And of course, you can use it just like the trashcan you've always had on your desktop.

  • + How have I only just discovered this? – Drazen Bjelovuk Aug 6 '17 at 1:55
  • 1
    ++ to delete the file immediately – Matt Sephton Aug 19 '17 at 14:17

What you can do is send the file(s) to trash, and then click Finder->Secure Empty Trash.

You can also make a keyboard shortcut to make that process a little quicker, as described in this article.

It's not exactly what you want, but seems to be the closest you can get without looking into creating something with Automator or Keyboard Maestro.

  • Nice article. What is Keyboard Maestro ? (perhaps a hyperlink to it in your answer if possible) – Simon Aug 13 '13 at 17:06
  • Excellent, much appreciated :) – Simon Aug 13 '13 at 17:08
  • I've added a link. It's an application that allows you to create various type of macros, or keyboard shortcuts, to do things quicker. You can create shortcuts to do some very complicated multi-step things. Probably overkill to buy for just this one task, though. – David Aug 13 '13 at 17:10

I have made a simple app in cocoa, which acts like the trash icon but with different behaviour ie. when a file or folder is dropped on its icon in dock, it deletes it permanently.

I have also written a blog post about it- Mac OS X : shift + delete

Here is the link for the app- DeleteMe

Basic idea is - use: rm -rf , exactly the same what is suggested in the most voted answer, but implemented in a different way ;-)


Now there is a better way to achieve 'permanent delete' functionality as specified by Matt Sephton in comment to this answer - Just use command + alt (option) + backspace. Thanks to him for the update.

You must log in to answer this question.

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