Deleting file beginning with '-' using rm

From: TiN (k_nitin_r_at_yahoo.co.in)
Date: 09/14/04


Date: 14 Sep 2004 00:57:41 -0700

Hi!

I accidentally created a file beginning with a '-' using gcc by
typing:
gcc -o -Wall prog1.c

I tried deleting it using 'rm', but to no means was I successful. I
tried using:

rm \-Wall
rm "-Wall"
  Interpreted it as a command line switch

ls ?Wall
ls *Wall
  I got a listing of all files in the current directory so didnt want
to try an 'rm'

I then used the GUI and it worked.

Anyway, what I'd like to know is how anyone would delete such a file
from the command line.

-TiN



Relevant Pages

  • Re: How do you make this Open Source work on Solaris ?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.programmer)
  • Re: How do you make this Open Source work on Solaris 10?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.shell)
  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... saying "any time I see this, ... The important thing is if i try to run the same using gcc helloworld.c ...
    (comp.lang.tcl)
  • Re: How do you make this Open Source work on Solaris ?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.programmer)
  • Re: hacked?
    ... because the scripts would just start adding a+x as a line before the gcc ... command line to the real program where it has been moved or renamed while ... Or you can kick back a response saying "your request has been logged and ... Its very very rare that an effort to use gcc and other common ...
    (comp.os.linux.security)