Skip navigation

How do I delete files & bypass the Trash?

33420 Views 16 Replies Latest reply: Mar 28, 2014 3:24 PM by ballparkfm RSS
1 2 Previous Next
bamim2 Level 1 Level 1 (0 points)
Currently Being Moderated
May 5, 2012 9:16 AM

Is there a way to completely remove files from my system without moving them to the Trash?

 

AND

 

I've read about the Trash, but I'm not clear on EXACTLY how it works. Can I empty A file from the trash or when I click on a file & choose "Emtpy the Trash" does it empty ALL of the files in the Trash or just that one file?

 

Is there a way to just empty ONLY 1 file from the trash or restore ONLY 1 file from the Trash if so how?

 

ALSO, what are the "rules" for MOVING files rather than COPYing them? I thought files that went from one folder to another on the same drive, were moved & ones that went to different drives were copied. It seems like I've run acrorss instances where that's not how things work.

Mac Pro, Mac OS X (10.6.8)
  • WZZZ Level 6 Level 6 (11,880 points)
    Currently Being Moderated
    May 5, 2012 9:57 AM (in response to bamim2)

    To delete a file or folder without moving it to the Trash, open Terminal in Applications>Utilities and copy/paste

     

    sudo rm -rf

     

    Then, important, leave a space after the -rf and drag the file or folder into the Terminal window -- it will then appear with the path of that file or folder -- and hit return. You will be asked for your admin password -- nothing will appear as you type it in -- and given a warning about using the sudo command, if this is the first time using sudo.

     

    Note: the rm command, especially run with sudo (sudo gives you root access) is a very dangerous command; it must be used with great care. No second chances.

     

    You cannot selectively empty the Trash. It's all or nothing. If you want to Trash a single file or folder, then move all the other ones you don't want to empty out of the Trash.

     

    AFAIK, dragging a file from one volume or drive to another should leave the original in place and move a copy over. I've never heard of any exceptions. However, if you are dragging a file or folder over using the Finder, I don't think the Permissions for the copy will necessarily be preserved, except for files or folders moved within your user, where your user is already the owner. Even within your user, the owner may be changed to your user, even if you are not the owner.

     

    Outside of your user, the permissions will be changed to reflect your user as owner, which will be wrong. So it's not a great way to copy over anything from /Library or /System/Library using the Finder, where the owner should be system or root, or other, not your user. If you do this, it's probably then a good idea to repair Permissions, so they are restored properly. That said, Permissions repair will not touch anything in your user.

     

    Moving things with the Finder isn't always the best way to do this.

  • LexSchellings Level 5 Level 5 (5,505 points)
    Currently Being Moderated
    May 5, 2012 9:53 AM (in response to bamim2)

    There is no such thing as delete while holding the shift key in windows.

    Either you do it with terminal, like wzzz explains, or you throw it in the Trash and then empty Trash while holding the CMD key: it will be overwritten with zero's.

  • WZZZ Level 6 Level 6 (11,880 points)
    Currently Being Moderated
    May 5, 2012 10:02 AM (in response to WZZZ)

    Please note, since I haven't tried copying/moving things over between volumes using the Finder in some time, I may not be remembering this caveat about Permissions correctly. Someone else may want to chime in and provide a correction, if necessary.

  • den.thed Level 7 Level 7 (23,390 points)
    Currently Being Moderated
    May 5, 2012 10:37 AM (in response to bamim2)

    The Trash is not a repository for iffy or junk files, it is for files that you no longer want and should be emptied on a regular bases.

     

    If you have files that are iffy, you should create a folder named (iffy, junk or save for trash) either on your Desktop or in your User Folder and keep them there until your ready to trash them.

    iMac, Mac Mini, iPad, iPods, Mac OS X (10.6.8), (10.7.3) Safari, iTunes, iPhoto
  • Kurt Lang Level 7 Level 7 (31,510 points)
    Currently Being Moderated
    May 5, 2012 11:10 AM (in response to bamim2)

    The Terminal is a good way to bypass the trash, but is very slow compared to this:

     

    1) Highlight whatever it is you want to trash as you normally would.

     

    2) Press Command+Backspace

     

    3) Press Command+Option+Shift+Backspace

     

    Once I've highlighted the files and folders I want to remove, I can do the keystrokes in - literally - one second. Maybe slightly more. This bypasses any messages about "Are you sure you want to permanently erase..."

     

    There are two things to watch out for. One, as has been mentioned, everything in the Trash will be removed when you empty it. There is no selective way to do it. Two, the keystrokes, as I said, give you no messages. The trash just plain empties. So make sure there's nothing in the trash you don't want removed, because you will get no secondary message to change your mind.

  • WZZZ Level 6 Level 6 (11,880 points)
    Currently Being Moderated
    May 5, 2012 11:18 AM (in response to WZZZ)

    OK, just tested to be sure about what I said about Permissions not being preserved when copy/moving  between volumes using the Finder to /Library or /System/Library. They are not. The owner becomes, incorrectly, your user and I believe may extend recursively to all nested folders in a directory.

     

    Must use instead:

     

    (sudo) cp -pR  

     

    including the path from the volume to the target volume (The R flag is for folders/directories, but not needed for files. Prefix with sudo, if necessary. The -p flag preserves Permissions in the move.)

     

    Kurt, some good keyboard acrobatics needed for that maneuver. But no problem for any virtuoso pianist who can span three octaves with one hand.

     

    Message was edited by: WZZZ

  • Király Level 6 Level 6 (9,470 points)
    Currently Being Moderated
    May 5, 2012 11:44 AM (in response to bamim2)

    You can delete files immediately with Terminal:

    rm -f (drag file to Terminal window, press return)

     

    To delete folders and their contents:

    rm -rf (drag folder to Terminal window, press return)

     

    To restore a file from the Trash, just drag it out of the Trash. Or click it once and hit Command-Backspace. The file will be put back to whatever location it was in before it was in the Trash.

     

    You are correct about moving vs. copying files. Dragging a file from one volume (i.e. disk) to another will make a copy of it. Dragging a file from one location to another on the same volume will move it, except when the user permissions do not allow the original file to be moved (such as applications or system files). Then a copy will be made.

     

    To delete a single item from the Trash, move everything out of the Trash that you don't want deleted, and then empty the Trash. Don't put files in the Trash that you are wanting to keep. Create a "purgatory" folder to stash files that you think you no longer want but can't bring yourself to delete just yet.

  • Kurt Lang Level 7 Level 7 (31,510 points)
    Currently Being Moderated
    May 5, 2012 12:13 PM (in response to WZZZ)

    Kurt, some good keyboard acrobatics needed for that maneuver. But no problem for any virtuoso pianist who can span three octaves with one hand.

    Nah! It's very easy. Left index finger on the left Command key, right hand on on the backspace key. Press. That moves everything into the trash. With your left index finger already on the Command key, it's a very quick move to just add the Option key with the middle finger, and the Shift key with the third finger since they're already basically hovering over those keys. Right hand is already still over the Backspace key. Press again to empty the trash.

     

    It sounds clumsy when you type out how to do it, but with just a little practice, you'd be surprised how fast it is. I t'wern't kidding about doing both keystrokes in one second.

  • Mark Jalbert Level 5 Level 5 (4,390 points)
    Currently Being Moderated
    May 5, 2012 1:18 PM (in response to bamim2)

    OK, TRASH exists within the relm of the Finder application. The .Trash folder (directory) in your home folder  is the accumulation of file(s) on the boot volume and the file(s) (including folders) that exist on other mounted volumes- /Volumes/<volume_name>/.Trashes/<your user id>/ folder (directory). So, when you trash a file(s) on the boot volume the file(s) are moved in your .Trash directory (folder) in your home folder, on other mounted filesystems (volumes), the file(s) are moved to the /Volumes/<volume_name>/.Trashes/<your user id> directory (folder).

     

    There isn't an option (as far as I know) to selectively remove files once they are in their respective trash folder.

  • noondaywitch Level 6 Level 6 (8,130 points)
    Currently Being Moderated
    May 5, 2012 2:03 PM (in response to Mark Jalbert)

    Mark Jalbert wrote:

     

    There isn't an option (as far as I know) to selectively remove files once they are in their respective trash folder.

     

    Removing single items from the Trash can be done by right-clicking the file and selecting 'put back' from the context menu.

    If the option isn't offered, you'll need to manually drag it out.

     

    Emptying the Trash from the Dock empties all trashes on all mounted volumes that the user has permissions for.

    i.e., emptying the trash from one account won't empty the trash for another user account.

  • Kurt Lang Level 7 Level 7 (31,510 points)
    Currently Being Moderated
    May 5, 2012 3:05 PM (in response to bamim2)

    Can I do a command button drag or something to move a file rather than copy it?

    Yes. As with Windows or Mac, any file or folder on the same drive/partition will always move by default. Any file/folder on a different drive/partition will always copy. To change that behavior:

     

    1) On the same drive/partition, hold down the Option key and it will force a copy rather than move. (You'll get a plus sign next to your cursor)

     

    2) On a different drive/partition, hold down the Command key to force a move rather than copy. (The plus sign will disappear)

     

    As noted above, this will work as long as there isn't some permissions restriction that won't allow the file to be copied or moved.

  • Wagringo Level 1 Level 1 (0 points)
    Currently Being Moderated
    Jan 29, 2013 5:51 PM (in response to bamim2)

    I know I am very late here... I came across this thread because:

     

    • Trying to move files on a mounted drive was copying, not moving, files between directories.

     

    In my case this behaviour was caused by locked files and had nothing to do with being on a mounted drive!

     

    These can be checked for by entering ls -lO in a terminal. If you need to change the locked flag from the terminal, see the chflags man page.

     

    Otherwise, the flag is easily changed by its owner in a finder "get info" window by toggling the "locked" button under "General".

     

    Sorry for adding to an old post, but hopefully this is useful to somebody else.

    MacBook Pro, Mac OS X (10.6.8)
  • jfiguerohunk Level 1 Level 1 (0 points)
    Currently Being Moderated
    Mar 24, 2013 11:33 AM (in response to bamim2)

    Hi guys! ive been trying to delete a pretty huge iphoto library. its in the 500+ GB. i have 400 gb of hd space left. empyting the trash bin's taking very very long. is there some other way to do this instantly? ive tried the procedure in Terminal described by Wzzz but im getting an illegal option warning. is there some other and faster way to delete this?

     

    thanks!

1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.