0

When I have a file named -19-5-20674., how can I delete that file?

When I use sudo rm:

$ sudo rm -19-5-20674.
rm: invalid option -- '1'
Try 'rm --help' for more information.

What can I do?

muru
  • 193,181
  • 53
  • 473
  • 722

1 Answers1

1

have a try withsudo rm ./-19-5-20674. or with sudo rm -- -19-5-20674.

your sudo reads the filename due to it's leading dash as an optional parameter / command option. most shells understand a double dash to signal end of command options. i circumvent this with a relative path as shown.

leisefuxX
  • 61
  • 6