6

I've somehow managed to create a file with the name "--help". If I try to remove the file using "rm" funny stuff happens. Please help

here's a printout of the dir listing:

[pavel@localhost test]$ ls -la
total 3640
drwxrwxr-x.  5 pavel pavel    4096 Jun 19 18:33 .
drwxrwxr-x.  6 pavel pavel    4096 Jun  9 12:23 ..
-rw-rw-r--.  1 pavel pavel 1070592 Jun 12 09:40 --help

3 Answers3

12

Either

rm ./--help

or

rm -- '--help'

See Utility Syntax Guideline 10 in the POSIX.1-2008 specification for a description of the end-of-options indicator, --

4
#!/usr/bin/env python

import os
os.unlink("--help")

Or you can do it interactively.

thanasisk
  • 151
4

Can you do...?:

ls -il
find . -inum [NUMBER] -exec rm -i {} \;

Super stolen from Squeezy.

dav_i
  • 141