Removing files with strange names

Posted by pythonic metaphor on Super User See other posts from Super User or by pythonic metaphor
Published on 2010-06-15T15:13:59Z Indexed on 2010/06/15 15:23 UTC
Read the original article Hit count: 233

Filed under:
|
|

Somehow I ended up with a file named "-r". How do I remove it? rm -r doesn't work. I tried 'rm -i `ls -a`' to step through the file names, but it didn't prompt me to delete this one.

Edit A very hacky approach was to use python's os.unlink function. That worked, but I'm curious to hear other ways.

© Super User or respective owner

Related posts about unix

Related posts about rm