Re: has something happened to grep

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



In article <482D8875.1050709@xxxxxxxxxxxxxxx>,
Jerry Geis <geisj@xxxxxxxxxxxxxxx> wrote:
> > Do you have a file name that starts with a "-" in your directory?
> >
> > Mogens
> 
> Yes I do actually. There is a -f filename of which I dont need.
> 
> I tried rm *f and it is not removing it. No what?

Ouch! That may well have deleted any other files with a name ending in f,
while leaving the file -f still there!

[tony@softins tmp]$ touch ./-f ae af ag be bf bg
[tony@softins tmp]$ ls
-f  ae  af  ag  be  bf  bg
[tony@softins tmp]$ echo *f
-f af bf
[tony@softins tmp]$ rm *f
[tony@softins tmp]$ ls
-f  ae  ag  be  bg

Easiest way to remove the file -f is: rm ./-f

Cheers
Tony
-- 
Tony Mountifield
Work: tony@xxxxxxxxxxxxx - http://www.softins.co.uk
Play: tony@xxxxxxxxxxxxxxx - http://tony.mountifield.org
_______________________________________________
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