1 2 Previous Next 16 Replies Latest reply: Mar 28, 2014 3:24 PM by ballparkfm
bamim2 Level 1 Level 1 (0 points)

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)
  • 1. Re: How do I delete files & bypass the Trash?
    WZZZ Level 6 Level 6 (12,205 points)

    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.

  • 2. Re: How do I delete files & bypass the Trash?
    LexSchellings Level 5 Level 5 (5,685 points)

    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.

  • 3. Re: How do I delete files & bypass the Trash?
    WZZZ Level 6 Level 6 (12,205 points)

    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.

  • 4. Re: How do I delete files & bypass the Trash?
    den.thed Level 7 Level 7 (23,900 points)

    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.

  • 5. Re: How do I delete files & bypass the Trash?
    Kurt Lang Level 7 Level 7 (31,990 points)

    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.

  • 6. Re: How do I delete files & bypass the Trash?
    WZZZ Level 6 Level 6 (12,205 points)

    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

  • 7. Re: How do I delete files & bypass the Trash?
    Király Level 6 Level 6 (9,475 points)

    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.

  • 8. Re: How do I delete files & bypass the Trash?
    Kurt Lang Level 7 Level 7 (31,990 points)

    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.

  • 9. Re: How do I delete files & bypass the Trash?
    Mark Jalbert Level 5 Level 5 (4,475 points)

    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.

  • 10. Re: How do I delete files & bypass the Trash?
    noondaywitch Level 6 Level 6 (8,130 points)

    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.

  • 11. Re: How do I delete files & bypass the Trash?
    bamim2 Level 1 Level 1 (0 points)

    WOW!! You guys are AWESOME!! Thank you for all of this. It's going to take me a while to sort this out, but there's a lot of great stuff here.

     

    Maybe I missed it, but can somebody also help me with the "move" rather than copy, please? I'm also having problems leaving crap behind because when I'm trying to move files, I end up just copying them & (obviously) I still leave stuff behind. In Windoze I can just right mouse (although I'm a lefty, so it's "other mouse") button drag a file, then choose 'move'. Can I do a command button drag or something to move a file rather than copy it? I guess I could just try it & see what happens...

     

    I'm an old UNIX guy, so I'm OK with the Terminal too, but I've hosed myself PLENTY of times doing stuff from the command line. No pain no gain though, eh? I mean, what fun is it without a little danger once in a while?

     

    THANK YOU ALL for all of these ideas though. This is GREAT stuff.

  • 12. Re: How do I delete files & bypass the Trash?
    Kurt Lang Level 7 Level 7 (31,990 points)

    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.

  • 13. Re: How do I delete files & bypass the Trash?
    Wagringo Level 1 Level 1 (0 points)

    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.

  • 14. Re: How do I delete files & bypass the Trash?
    jfiguerohunk Level 1 Level 1 (0 points)

    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