1

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
  • 207,228
Msk Dev
  • 11

1 Answers1

2

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
  • 81
  • 6