[CentOS] how to delete file "--filename"??

Kwan Lowe kwan.lowe at gmail.com
Tue Dec 15 16:17:18 UTC 2009


2009/12/15 mcclnx mcc <mcclnx at yahoo.com.tw>:
> i have file on CENTOS 4.6 and I tried to delete it failed.  I have been tried following way but NOT work:
>
> rm -i *
>
> rm --filename
>
> rm \--filename
>
> rm "\--filename"
>
> rm '\--filename'
>
> any ideal?

Many ways to do it.. The method I prefer:

List your files by inum:
   ls -i

Find the inum associated with the file you want to delete. Then:

   find /path/to/containing/dir -inum 12345 -exec rm {} \;



More information about the CentOS mailing list