Re: How to delete files with specical characters in the name?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Jan 22, 2008 8:46 AM, Eric B. <ebenze@xxxxxxxxxxx> wrote:
> Hi,
>
> I've got an odd situation here.  Somehow, I find myself with two files that
> start with the - character.
> [eric@apollo mysql]$ ls -l
> total 93348
> -rw-r--r--  1 mysql mysql  9273344 Nov 13 19:03 -N=2007-11-08
> -rw-r--r--  1 mysql mysql 38879232 Nov 13 19:02 --newer=2007-11-08
>
>
> Don't ask how they were created; something went wrong with a script at some
> point.
>
> My problem is that I am trying to delete them, but can't figure out how to
> delete these files.  Everything I try, I get the same msg:
> [eric@apollo mysql]$ rm '-N=2007-11-08'
> rm: invalid option -- N
> Try `rm --help' for more information.
>
>
> I have tried single quotes, double quotes, escaping it with a \ and still
> get the same error.
>
> Any ideas / suggestions?
>
> Thanks!
>
> Eric
>
The manpage is your friend:

To  remove  a  file  whose  name  starts  with a '-', for example
       '-foo', use one of these commands:

              rm -- -foo

              rm ./-foo
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux