[CentOS] Removing a file that starts with dashes

Pete Geenhuizen pete at geenhuizen.net
Wed Apr 2 17:43:38 UTC 2014


On 04/02/14 10:51, m.roth at 5-cent.us wrote:
> Frank M. Ramaekers wrote:
> Method 1: try rm \-\-backup\=numbered
> Method 2, that will *ALWAYS* work:
> ls -i
> then, using the inode number
> find . -inum <inode> -exec rm {} \;
>
> The latter method is the one guaranteed to take care of all kinds of
> filenames with weird, or unprintable, stuff in the name.
>
>         mark
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
Use rm -i *
It will usually catch the file and because it's a special character it 
and many other odd ball file names usually appear in the very beginning 
so you don't have to go through the entire list.

-- 
Unencumbered by the thought process.
  -- Click and Clack the Tappet brothers




More information about the CentOS mailing list