How do I remove a file with the name '-something'?

1 answer

Answer

1126571

2026-03-16 14:55

+ Follow

To remove a file with a name starting with a hyphen (e.g., '-something'), you can use the rm command with a double dash (--) to indicate the end of options. For example, run rm -- -something. Alternatively, you can specify the file path using ./, like this: rm ./-something.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.