How to delete in Terminal?

Thai•ZX-6R

Registered
I'm new to all this and when I try to run MySQL, it says that my one file could not be deleted and that I need to do it manually. It's a pid file. It won't let me just drag it to the trash so I'm wondering how to delete it in terminal...

I know "mkdir" is make directory, "cd" is change directory etc... so the simple question is how do I delete?

Thanks.
 
A pid file may require root privileges in order to remove it:
sudo rm /path/to/file

rm -rf for directories (recursive force remove).

For directories with root ownership, you will have to do:
sudo rm -rf /path/to/dir
 
THANK YOU! -rf! -rf!

I am so glad I didn't have to wait for the Trash to delete all the 10GB of files I had in there. I just used rm and it did it in a millisecond.

Why doesn't the Trash Can use the Terminal to delete files? It'd be so much faster.
 
not safe though,, cuz what if (sometime_in_the_future) u realise that needed those files or maybe just one of them

ooops no way gettin it back!
actually there is, but NO
 
Well, I only do it on stuff I KNOW I won't need. They were a duplicate of my entire HD. So.. you know.
 
Wow! Cool, i had a file on my desktop, that WOULD NOT Delete ... it told me it was in use ... but a restart didn't cure it. Using basic structure, i removed the file with Ease! ... that is COOL! ... i might start looking at trying to learn the terminal, and its commands! ;)

Neyo
 
When you delete a file it isn't removed from file system until all application finish tu use it ...
So if you open a file then delete it another application can't open it but the first applicaton can continue to use it.

It's fs feature!

Bye_
 
Originally posted by Easter
When you delete a file it isn't removed from file system until all application finish tu use it ...
So if you open a file then delete it another application can't open it but the first applicaton can continue to use it.

It's fs feature!

Bye_

I guess that's because the file would still be in RAM and therefore not entirely removed from the computer :)
 
Hi ksv,

Originally posted by ksv
I guess that's because the file would still be in RAM and therefore not entirely removed from the computer :)

no ... the effect is the same but the reason isn't that ...
The file remain available to the application using it even if the file is much more greather than the memory available ... try to delete a video while you are watching it. Is the Kernel, FileSystem, etc... that use this non-blocking strategy ... just think that in UNIX everything is a file (even memory, devices, processors, framebuffer).

That's all_
 
Back
Top