Search code examples
rm

Unable to remove a special named files in terminal


Some program makes ta my root directory dummy files such as

-1
-2
-3
...
-n

I run unsuccessfully

rm -1

and too

rm "-1"

Terminal thinks that -1 is the option.

How can you remove the files in terminal?


Solution

  • You can use rm ./-1, the ./ refers to the current directory and as the parameter doesn't start with a dash it isn't interpreted as an option.