View Full Version : Deleting with terminal
Haberdasher
Jun 30, 2003, 12:49 PM
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.
mnkeybsness
Jun 30, 2003, 01:16 PM
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.
Haberdasher
Jun 30, 2003, 01:31 PM
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
mnkeybsness
Jun 30, 2003, 01:55 PM
this is a very basic unix tutorial from the university of minnesota computer science department: here (http://www-users.cs.umn.edu/~skim/cs1901/tutorial.html)
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.
tpjunkie
Jul 1, 2003, 10:55 AM
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
Dale Sorel
Jul 1, 2003, 02:40 PM
Originally posted by Haberdasher
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?
Here's a good place to start: http://www.osxfaq.com/Tutorials/LearningCenter/
vBulletin® v3.6.10, Copyright ©2000-2009, Jelsoft Enterprises Ltd.