Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Haberdasher

macrumors regular
Original poster
Jul 24, 2002
142
0
Los Angeles, CA
How can you use the terminal or the inner workings of MacOSX to force delete files? I have two files which I know are no longer in use, after multiple reboots, but one of them , a failed IE download, will not move to the trash despite repeated attempts, since it seems to think it is in use.

Another is a small application which cannot delete because it is also "in use". Clearly this is not the case.

Can someone help me and tell me how you can force the deletion of these items? Thanks.
 
use the 'cd' command to find the file
cd 'directory'
in the terminal you will start in your home directory. to move somewhere else on the hard drive, such as the applications folder, type 'cd /applications'.
use the 'ls' command to see each folder's content.
as an example, i created a folder called "deleteme" with a document inside called "document.rtf"

note: 'Shannon' is the name of my computer, yours will be whatever your computer is named. 'myaccount' will be your account name. type every command after the % sign.

so now i will type the following
[Shannon:~] myaccount% cd /applications/deleteme
terminal will return:
[Shannon:/applications/deleteme] myaccount%
to delete the document, i type the 'rm' command for "remove"
[Shannon:/applications/deleteme] myaccount% rm document.rtf
you can double check to make sure the item was deleted by typing 'ls'. if the file will not remove because you don't have permission, you will need to type the following as a sudo root user: this will ask for your administrator password immediately following the command:
[Shannon:/applications/deleteme] myaccount% sudo rm document.rtf
to remove that 'deleteme' directory, you need to use the 'rmdir' (remove directory) command. but first we need to move back one folder using 'cd ..'
[Shannon:/applications/deleteme] myaccount% cd ..
[Shannon:/applications] myaccount%
now i want to use the 'rmdir' command:
[Shannon:/applications] myaccount% rmdir deleteme

hope this works for you, but be careful with what you delete.
 
Ha! Excellent! Worked exactly as you said. Now you've got me all interested in Terminal stuff...are there any free FAQs where I can learn more about basic terminal commands such as the ones you've described?

Oh, and thanks a lot! :D
 
this is a very basic unix tutorial from the university of minnesota computer science department: here

i don't know of anymore...perhaps try searching google for a while. most people really start learning languages like this by just playing around and messing with stuff. just remember to be careful with what you mess with.
 
For anyone interested that doesn't like to mess around in terminal, you can boot up in os 9, and easily delete those pesky incompleted IE downloads...i figured that out when it happened to me, that was my last resort before going to the terminal
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.