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).
7 Answers
Delete Immediately @ Github (free)
- Download the file
Delete Immediately.service
- Move the file to
~/Library/Services
. You may have to create the folder. - Restart the finder by running
killall Finder;
- You can also assign a keyboard shortcut to this service in System Preferences → Keyboard → Keyboard Shortcuts →Services
-
4
-
Very nice. Also works with the Services submenu under Path Finder, for those who use it. Jan 25, 2017 at 19:19
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
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.
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. Apr 4, 2014 at 14:15
-
In a more recent OS X versions there is a
Backspace
key instead ofDel
used. Jun 23, 2015 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. Aug 6, 2015 at 10:21
-
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? Mar 28, 2018 at 19:50
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.
-
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.– JamesJun 6, 2014 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. Jun 6, 2014 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:
- type
rm -rf
in the terminal (with a trailing space). - 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.