PDA

View Full Version : How do I delete locked files?




Proto Media
Dec 7, 2006, 08:43 PM
Ok so I had a backup drive which is just a mirror of my normal drive. I am now selling my computer and want to delete all the files off the HD and do a fresh install of Tiger before I sell it. When I go to empty the trash, it says something like there is 17,000 items in it, and about a minute in it says "cannot delete said item because said item is in use"

This is AFTER I reinstalled Tiger. I chose the erase destination disk first, then install, thinking it would trash all these locked files, but after rebooting, my trash is still full of the same files that were on there before I did the re Install.

Does anyone know how to just like, blast the trash or something, some force trash command or something, maybe something with terminal? These files are taking up like 20 GB of room and I would really like to get them off of there before I go and sell the computer.

It is a dual 2Ghz PMG5. I know I can go into eash individual file and unlock it, I think thats whats causeing the problem cause I think they are like application files or something and the computer thinks that it needs them so it wont let them be deleted, but I would prefer not to have to unlock 17,000 files.

Any help is greatly appreciated. Thanks in advance!

- Ryan



WildCowboy
Dec 7, 2006, 08:49 PM
I'm not sure I follow everything you said, but try using "Secure Empty Trash" from the Finder menu.

PkennethV
Dec 7, 2006, 08:52 PM
give this a try
http://mac.softpedia.com/get/Security/Delete-It.shtml
if you're only using it once then you don't have to buy it.

-----ken-----

pianoman
Dec 7, 2006, 08:52 PM
i'm not sure i understand either, because doing a fresh install should erase everything. if nothing else, try reinstalling the OS again and select the option that clears the hard disk (if you haven't done this already). perhaps also try reformatting the hard disk (which will erase everything on the disk) using the installation CD and then going through with installing the OS.

skunk
Dec 7, 2006, 08:54 PM
If you put all the items in the trash into a folder on the desktop, you can then highlight the folder, click Cmd+I, uncheck the locked file box and click on "apply to all enclosed items". Then try trashing them again. That might work. I think.


Alternatively, I might be talking complete bollox. :o

Dont Hurt Me
Dec 7, 2006, 09:24 PM
Use the file tab after being in that program thats locked, use get info to get access from there you can unlock it. Then trash it . At least thats how I remember it. or try skunks way.

Proto Media
Dec 7, 2006, 09:34 PM
PkennethV you are the Sh** Thank you so much for that link, I downloaded the software, and now those 17,000 files are gone! Thanks again so much you have no idea how much you have helped someone out. And thank you to all of the other people that replied.

GOOD DAY!

paxx
Dec 7, 2006, 11:27 PM
PkennethV you are the Sh** Thank you so much for that link, I downloaded the software, and now those 17,000 files are gone! Thanks again so much you have no idea how much you have helped someone out. And thank you to all of the other people that replied.

GOOD DAY!

I realize that your problem has been solved but here is another way to skin that "delete locked file" cat.

Hold down the option key as you empty the trash from either the Finder menu or while pressing shift/alt/delete keys.

Holding the option key will delete any locked files that are in the trash.

Pax

nichos
Dec 7, 2006, 11:37 PM
This happened to me before. I ended up going to the terminal and:
sudo rm -rfv /Path/To/File/FileName

of course, trash is in ~/.Trash. In that case you'd want to:

rm -rfv ~/.Trash/*

:)

Transeau
Dec 8, 2006, 12:55 AM
This happened to me before. I ended up going to the terminal and:
sudo rm -rfv /Path/To/File/FileName

of course, trash is in ~/.Trash. In that case you'd want to:

rm -rfv ~/.Trash/*

:)

sudo rm -rf ~/.Trash/*

this is exactly what I do too.

theblotted
Dec 9, 2006, 09:09 AM
sudo rm -rf ~/.Trash/*

this is exactly what I do too.


i've tried this before and it doesn't work everytime. at times it'll say "not permitted".

this is when i reveal all hidden files that are locked, and unlock'em manually.

whipstitch
Dec 21, 2006, 07:10 PM
I realize that your problem has been solved but here is another way to skin that "delete locked file" cat.

Hold down the option key as you empty the trash from either the Finder menu or while pressing shift/alt/delete keys.

Holding the option key will delete any locked files that are in the trash.

Pax

AWESOME. Been using Terminal and a bunch of commands I don't understand, like "sudo rm -r /~ ...." and NOTHING. The files won't delete. Held option and BOOYAH. BOOOOOYAH!

paxx
Dec 22, 2006, 12:52 AM
AWESOME. Been using Terminal and a bunch of commands I don't understand, like "sudo rm -r /~ ...." and NOTHING. The files won't delete. Held option and BOOYAH. BOOOOOYAH!

Glad it helped!!

cinema1965
Apr 23, 2009, 02:46 PM
I've noticed that this thread is kind of old, but it is still there on google search results. After hours of trying many different things to try to delete thousands of LOCKED files from my computer, I came across a way to do this without having to download or buy anything, Mac computers are the best. Here is a step-by-step different solution for this problem.

1. Open Applications....... Utilities ....... Terminal
2. Copy and paste ( chflags -R nouchg ) inside terminal screen. do not press return yet
3. Open trash bin
4. Press command-A to select all files at once
5. Drag them all inside the Terminal screen
6. Press return
7. You are done! close everything. open trash and delete all your files.

It is so easy. I am sure someone out there will know a better way.... I wish they had posted before. I spent 4 hours trying to get rid of those damn files. I hope you find this thread for this will put a smile in your face.:)

cinema1965
Apr 23, 2009, 02:52 PM
Perhaps, someone can teach me how to set up newest thread replies up top...:o

awmazz
Apr 23, 2009, 04:21 PM
It is so easy. I am sure someone out there will know a better way.... I wish they had posted before. I spent 4 hours trying to get rid of those damn files. I hope you find this thread for this will put a smile in your face.:)

Did you not try holding down the option key while emptying the trash? It seems the easiest solution and works every time for me.

cinema1965
Apr 23, 2009, 05:34 PM
Did you not try holding down the option key while emptying the trash? It seems the easiest solution and works every time for me.

I have a 1 year old MacBook Pro and it does work at all. Is there a box I should check somewhere in the system preference folder?

a4cab03
Aug 12, 2009, 05:07 PM
I've noticed that this thread is kind of old, but it is still there on google search results. After hours of trying many different things to try to delete thousands of LOCKED files from my computer, I came across a way to do this without having to download or buy anything, Mac computers are the best. Here is a step-by-step different solution for this problem.

1. Open Applications....... Utilities ....... Terminal
2. Copy and paste ( chflags -R nouchg ) inside terminal screen. do not press return yet
3. Open trash bin
4. Press command-A to select all files at once
5. Drag them all inside the Terminal screen
6. Press return
7. You are done! close everything. open trash and delete all your files.

It is so easy. I am sure someone out there will know a better way.... I wish they had posted before. I spent 4 hours trying to get rid of those damn files. I hope you find this thread for this will put a smile in your face.:)

Thanks a bunch Cinema.
Your method works great.

I had a couple of locked files on my USB shared drive (through the airport) that prevented me from deleting everything on the drive.

floatingspirit
Nov 17, 2009, 02:36 PM
Did you not try holding down the option key while emptying the trash? It seems the easiest solution and works every time for me.

It won't go into the trash...

lannister80
Nov 17, 2009, 04:33 PM
Nuke from orbit, it's the only way to be sure they're deleted.