Deleting files without using Trash

Discussion in 'macOS' started by typecase, Dec 9, 2006.

  1. typecase macrumors 6502


    Feb 2, 2005

    Something has been bugging me for a while now. I haven't found a way to delete a file without using the trash can. I can do it with the command line, but this is cumbersome sometimes. In Windows, I could select a file and hold down control while I hit delete and it would bypass the recycle bin and be deleted. Is there a way do this with Mac OS X?

    I find this problem most annoying especially when dealing with removable drives (like USB drives) as the files are left on the drive. The only way to remove them is to use the command line or empty my entire trash can. Sometimes I'm not ready to empty the trash quite yet. Speaking of which, in windows, you could go into the recycle bin and "empty" or delete specific selected files. It seems in Mac OS X, you can only empty the entire trash can to permanently delete a file without using the command line.

    Am I missing something? Please help. Is there a way to delete by bypassing the trash can? :confused:
  2. pianoman macrumors 68000


    May 31, 2006
    i don't know of any way to bypass the trash can, but you can hit shift+cmd+delete to empty the trash can using your keyboard instead of using your mouse to left click and select "Empty Trash."
  3. danny_w macrumors 601

    Mar 8, 2005
    Austin, TX
    Here Here! When is Apple going to provide something as simple as the Ctl-Delete in Windows to bypass the Trashcan? This is probably the most missed feature from Windows for me, and it is very annoying.
  4. rdowns macrumors Penryn


    Jul 11, 2003
    Command-Delete (backspace key) will put a file in the trash without dragging it.
  5. danny_w macrumors 601

    Mar 8, 2005
    Austin, TX
    Thanks, I'll try that. I thought sure that I already had tried it, but perhaps not.

    EDIT: OK, that works fine. Thanks again! I had been trying to use the 'delete' key that is above the cursor keys/to the right of the keyboard (the one with an 'x' on it); it didn't do anything.
  6. Westside guy macrumors 603

    Westside guy

    Oct 15, 2003
    The soggy side of the Pacific NW
    Since the bash command line "rm" doesn't involve the trash can, it would probably a simple thing to make an AppleScript droplet that'd do an immediate delete.
  7. typecase thread starter macrumors 6502


    Feb 2, 2005
    As I mentioned in my post, I often use rm to bypass the trash completely if there's a file on a removable disk I want to delete permanently (and recover the space on said disk) but am not quite ready to empty the rest of the trash. I'm guessing there's no direct way do this without using rm and the terminal. I suppose something could be rigged by writing a script but the OS should have this basic functionality. It's a shame, too. It'd be nice to be able to hold down the command key and hit the delete button and the file would just disappear (without moving to the trash at all--if this was not clear before I apologize). Also, it'd be great to be able to do this inside the trash as well to permanently delete specific files without emptying the rest of my trash.
  8. danny_w macrumors 601

    Mar 8, 2005
    Austin, TX
    Also, is there any way to rummage through the trash and delete just certain files or restore certain files to their original place? Both these actions are built into Windows, and are very easy. Surely there is an equivalent on Mac.
  9. numlock macrumors 68000

    Mar 13, 2006
    There is a automator plugin that deletes the files/folders completely. I have it as a plugin in the contextual menu. Theres also compost which you gives you the same basic function. But you can get burned using these utilities its happened to be with both of these softwares. Atleast the automator plugin gives you the popup menu to select yes or no.

    To go through the trash and delete some and restore some i think you would need a third party application. Maybe pathfinder can do it now but filerun (which to me looked very promising) was supposed to do this among other things but its almost a year since was supposed to ready so who knows
  10. ddekker macrumors regular

    Sep 23, 2006
    we had a designer that uses a mac "lose" a folder full of files I was wondering if there was a way that he could have deleted them without them making it to the trash can by hitting some strange key combination, everyone is pretty sure someone cam in through the network and nuked paranoia.. he was copying files from his laptop to another users PC through the network...

  11. Macguy97 macrumors newbie

    Sep 11, 2010
    Can someone generate an AppleScipt for this?

    An AppleScript would be great for this.

    You could then save it in the services menu. That way, right-clicking would perform the AppleScript an delete the file?

    How would you get the AppleScript to point to the file though? :confused:
  12. Jolly Jimmy macrumors 65816

    Jolly Jimmy

    Dec 13, 2007
    Try this one I wrote.

    tell application "Finder"
    	set theSelection to selection
    	if theSelection is {} then
    		activate current application
    		display alert "No files are selected for deletion." message "Select one or more files to delete." as warning
    		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 & ""
    					do shell script deleteit
    				on error
    					do shell script deleteit with administrator privileges
    				end try
    			end repeat
    		end if
    	end if
    end tell
  13. burak.duvan macrumors newbie

    May 5, 2010
    When you eject removable drives, they are removed from trash. If you do not unmount (cmd+e) the drives before you unplug them, it won't delete the files.

    But I have a problem opposite to yours. I cannot send the files to trash. When I remove (cmd+backspace) the files, Finder permanently deletes them. I do not know what I did, but I don't want to delete all my files permanently, and I do not want to erase my disk and install a fresh OS X. Is there anybody who experiences the same problem?

  14. Mr. Retrofire macrumors 603

    Mr. Retrofire

    Mar 2, 2010
    This does not delete the files. The files are still in the trash folder on the ejected volume. Btw, if you do not unmount the volume(s) before you unplug the drive(s) you can damage the file system structures on the volume(s), which can lead to data loss.
  15. mmccarn macrumors newbie

    Mar 22, 2015
    For total noobs like me - Here are step by step instructions to create a"Delete Permently" option in Finder:

    1. use spotlight to find and run "Automator" (OS X 10.4+)
    2. Select 'Service'
    3. Under 'Service receives selected', choose "files or folders".
    4. Under 'in' select ""
    5. Make sure the 'Actions' is selected at the top left and search for "applescript" in the 'Name' search box
    6. Drag 'Run Applescript' into the editor window
    7. Replace the line that says '(* Your script goes here *)' with the code supplied by Jolly Jimmy
    8. Click 'File', 'Save' and name your menu item "Delete Permanently" (or another name of your choice)
    9. Close Automator

    You now have a 'Delete Permanently' (or whatever) item on the right-click menu for any file on your system, including individual files in the trashcan.

  16. xetmarcr macrumors member


    Nov 9, 2014

Share This Page