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.

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).

share|improve this question

6 Answers 6

up vote 22 down vote accepted

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

share|improve this answer
1  
This tool has been initiated by user @jtbandes! –  gentmatt Mar 13 '12 at 19:22
    
Nice to know about this. –  Chiron Mar 13 '12 at 21:38
1  
+1, thanks for sharing - a nice find! –  JW8 Mar 13 '12 at 21:59
1  
I've recompiled the project and reinstalled the resulting Delete Immediately.service and it's working fine now. –  Daniel Serodio Mar 15 '12 at 17:12
4  
Wow! People are still using this? Great! :) –  jtbandes Mar 20 '12 at 16:36

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

share|improve this answer
    
+1, good link to the automation site, a very helpful resource. –  JW8 Mar 13 '12 at 21:59

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.

share|improve this answer

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

share|improve this answer
    
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 at 14:15

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

share|improve this answer
    
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 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 at 14:31

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

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.