29

Is it possible to really delete a file (ie, bypass the Trash) from Finder? Currently, when I want to reclaim space from a USB drive, I rm files/folder from the Terminal, but I'd like to do it from the GUI (similar to Shift+Delete in Windows).

26

Delete Immediately @ Github (free)

  1. Download the file Delete Immediately.service
  2. Move the file to ~/Library/Services. You may have to create the folder.
  3. Restart the finder by running killall Finder;
  4. You can also assign a keyboard shortcut to this service in System Preferences → Keyboard → Keyboard Shortcuts →Services

screenshot of the app's context menu

screenshot of the app's confirmation dialog

  • 4
    Wow! People are still using this? Great! :) – jtbandes Mar 20 '12 at 16:36
  • Very nice. Also works with the Services submenu under Path Finder, for those who use it. – chazlarson Jan 25 '17 at 19:19
8

No - there's no shortcut for that, but there is a services menu to extend Finder, flexibly bending it to accommodate your wishes.

You'll want to define a service that calls a script to rm or srm and bind the keyboard shortcut of your preference to the service.

Automator's built in help can assist with learning to make a service.

Also invaluable is the site http://www.macosxautomation.com/ which is made by the automation guru Sal Soghoian

4

I came across an AppleScript that does something similar to what @bmike has suggested. User Jolly Jimmy listed in a forum post:

tell application "Finder"
    set theSelection to selection

    if theSelection is {} then
        beep
        activate current application
        display alert "No files are selected for deletion." message "Select one or more files to delete." as warning
    else
        activate current application
        display alert "Delete item(s)?" message "The selected item(s) will be deleted immediately. Are you sure you want to continue?" buttons {"OK", "Cancel"} as warning
        set buttonpressed to button returned of result

        if the buttonpressed is "OK" then
            repeat with i from 1 to (count theSelection)

                set item1 to (the quoted form of POSIX path of (item i of the theSelection as alias))
                set deleteit to "rm -rf " & item1 & ""

                try
                    do shell script deleteit
                on error
                    do shell script deleteit with administrator privileges
                end try
            end repeat
        end if
    end if
end tell

Add this script to the services menu, and you should be able to delete by right-clicking.

4

You could do Command-Delete to move to the trash can and then Command-Shift-Delete to empty the trash can

  • This is basically muscle memory for me. Any time I trash something (which I always use command+del) I immediately empty the trash using command+shift+del. It's still two steps but it only takes a fraction of a second. – Mr Rabbit Apr 4 '14 at 14:15
  • In a more recent OS X versions there is a Backspace key instead of Del used. – TranslucentCloud Jun 23 '15 at 6:30
  • @TranslucentCloud, that's not correct; Apple hardware labels the key as <kbd>Delete</kbd>, at least in U.S. English keyboards. You may have been looking at a non-U.S.-English keyboard, or another maker's keyboard attached via USB. – whiskeychief Aug 6 '15 at 10:21
  • @whiskeychief, yes, I'm looking at some Logitech keyboard. – TranslucentCloud Aug 11 '15 at 14:10
3

I know the OP was about Lion, but in a newer version you can do that by pressing: ⌘ Command⌥ Option⌫ Delete

Tested on Sierra

  • This was working on my High Sierra machine for almost a year but suddenly stopped working. Was this feature removed? – GreenRaccoon23 Mar 28 '18 at 19:50
1

I like Trash Without. It's in the app store (not free).

It has an icon available for the dock and the toolbar, but best of all for me is you can add a button in Finder for drag and drop.

enter image description here

  • How did you add the icon to the finder toolbar? I have Trash Without installed, but cannot find out how to add it to finder. – James Jun 6 '14 at 9:35
  • See youtube.com/watch?v=21MXGpyaaD0. It's at the very beginning. In Finder, go to your Applications folder and drag the app to the Finder toolbar. – Tyler Collier Jun 6 '14 at 14:31
0

Not a fully-GUI answer, but you can make the procedure much easier by using a Finder+Terminal+Drag'n'drop approach, i.e. given that you have a terminal window opened, and a non-overlapping Finder window:

  1. type rm -rf in the terminal (with a trailing space).
  2. Drag the required folder from Finder to the terminal window and press Enter.

Hint: To remove the current folder in Finder, drag the blue icon in the Finder's title bar. This will also work with text editor windows or any OSX app that has a normal title bar displaying the current path or file name.

Hint2: If you are dragging the file/folder from a window that overlaps the Terminal window, then drag the file to the Terminal's icon in the dock, wait until the Terminal windows are displayed and then continue dragging into the the one you need.

drag the blue icon

You must log in to answer this question.

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