LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   I feel stupid asking this... (http://www.linuxquestions.org/questions/linux-general-1/i-feel-stupid-asking-this-12233/)

mjakob 01-20-2002 09:57 PM

I feel stupid asking this...
 
But, here it goes.

Ok, so I made a bit of a mistake with tar, and now I have a 500MB file in the root of the / directory called -X:
[root@mail /]# ls -al
total 514268
-rw-r--r-- 1 root root 525977600 Oct 18 11:12 -X
drwxr-xr-x 17 root root 4096 Oct 18 11:11 .
drwxr-xr-x 17 root root 4096 Oct 18 11:11 ..
drwxr-xr-x 2 root root 4096 Sep 9 20:32 bin
<snip>


Now, I've obviously tried this:

[root@mail mail]# rm -X
rm: invalid option -- X
Try `rm --help' for more information.
[root@mail mail]#

And I've tried it in quotes:

[root@mail mail]# rm "-X"
rm: invalid option -- X
Try `rm --help' for more information.
[root@mail mail]#

Same thing. I've tried rm *x:

rm *X
rm: invalid option -- X
Try `rm --help' for more information.
[root@mail /]#


So anyway, how in the heck do I get rid of this file? I've got plenty of space on the disk, but it ticks me off, plus it gets written into the backup every night which is stored on another server via nfs, which causes excess network traffic and hogs space on that box as well. If anyone can point out hoe to make this gone, I'd REALLY appreciate it.

Thanks,
Mark

notsoevil 01-20-2002 10:11 PM

rm -- -X

The '--' signifies the end of options.

mjakob 01-20-2002 10:39 PM

It worked. I salute you. Thanks a bunch! :)

I'm so happy now. I knew someone would know.

Thanks,
Mark

inv|s|ble 01-20-2002 11:48 PM

you could have also done rm "-X"

trickykid 01-20-2002 11:54 PM

Quote:

Originally posted by inv|s|ble
you could have also done rm "-X"
he seemed to have tried that.
Quote:

And I've tried it in quotes:

[root@mail mail]# rm "-X"
rm: invalid option -- X
Try `rm --help' for more information.
[root@mail mail]#

notsoevil i think in this case gave one of the few ways to remove this file.

inv|s|ble 01-21-2002 12:15 AM

this is the last time, i browse the questions, without my coffee first thing in the morning..

Mik 01-21-2002 03:31 AM

I could have used that -- option a while ago. I was struggling with the same problem. I managed to delete the file by logging in through ftp and then giving the delete command. But using the -- would have been a nicer way to do things.
Always so much to learn about linux.


All times are GMT -5. The time now is 06:39 PM.