Deleting files without using Trash

Discussion in 'OS X' started by typecase, Dec 9, 2006.

  1. macrumors regular

    Joined:
    Feb 2, 2005
    #1
    Hello,

    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. macrumors 68000

    pianoman

    Joined:
    May 31, 2006
    #2
    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. macrumors 601

    Joined:
    Mar 8, 2005
    Location:
    Austin, TX
    #3
    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. macrumors Penryn

    rdowns

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

    Joined:
    Mar 8, 2005
    Location:
    Austin, TX
    #5
    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. macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy part of the Pacific NW
    #6
    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. thread starter macrumors regular

    Joined:
    Feb 2, 2005
    #7
    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. macrumors 601

    Joined:
    Mar 8, 2005
    Location:
    Austin, TX
    #8
    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. macrumors 65816

    Joined:
    Mar 13, 2006
    #9
    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. macrumors regular

    Joined:
    Sep 23, 2006
    Location:
    Michigan
    #10
    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 it..lol... paranoia.. he was copying files from his laptop to another users PC through the network...

    DD
     
  11. macrumors newbie

    Joined:
    Sep 11, 2010
    Location:
    Brisbane
    #11
    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. macrumors 65816

    Jolly Jimmy

    Joined:
    Dec 13, 2007
    #12
    Try this one I wrote.

    Code:
    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
     
  13. macrumors newbie

    Joined:
    May 5, 2010
    #13
    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. macrumors 601

    Mr. Retrofire

    Joined:
    Mar 2, 2010
    Location:
    www.emiliana.cl
    #14
    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.

    http://forums.macrumors.com/showthread.php?p=13005577#post13005577
     
  15. macrumors newbie

    Joined:
    Mar 22, 2015
    #15
    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 "Finder.app"
    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. macrumors newbie

    Joined:
    Nov 9, 2014
    Location:
    ID

Share This Page