PDA

View Full Version : [ubuntu] How do I delete a file through the terminal?



fullerama
November 15th, 2008, 10:17 PM
I tried following a "how-to" on backing up my system into a "tgz" file, and it seems to have worked. However, I failed to realize beforehand that I had no storage facility large enough to accomodate the file created (backup.tgz), so I'd like to delete it.

I have tried using rm command, but I get an error:

rm: invalid option -- b

Have tried listing the / directory, and "backup.tgz" shows up in that list, but it is in red type.

Can anyone help me get rid of this very large file?

Thanks!

rampageoberon
November 15th, 2008, 10:23 PM
I understand the file is at /backup.tgz
So if you are the owner it is quite straight forward, use the comand


rm -f /backup.tgz

If you are not the owner you will need to use sudo before that command. Be careful using sudo and rm as there's no getting files back (or an easy way to get files back).

master5o1
November 15th, 2008, 10:26 PM
[sudo] rm /backup.tgz

fullerama
November 15th, 2008, 10:37 PM
Thanks, I think I may have left out the slash in the command. I appreciate the help, as always!

metallicamike
November 15th, 2008, 10:56 PM
also rm -r and then drag and drop the file, but make sure you take out the quotes on the directory!

boof1988
November 15th, 2008, 11:28 PM
also rm -r and then drag and drop the file, but make sure you take out the quotes on the directory!

Can you explain a little?

Do you mean the following?

Using CLI:

rm -r

Then drag and drop from where to where?

I'd like to learn a new way to do stuff... Thanks.

metallicamike
November 16th, 2008, 01:18 AM
drag the file you want to delete into the terminal window and the directory shoud pop up:) and yes like that