How to remove special character filename in Linux?

35 Views Asked by At

I have a filename with -v. I try to remove it by

rm -v or rm "-v" or rm ¥-v

But it shows something like

rm: missing operand
Try 'rm --help' for more information.
1

There are 1 best solutions below

0
DeaDSouL On BEST ANSWER

I have a filename with -v

Try:

rm -- '-v'

If you need to use rm option like verbose for example, try:

rm -v -- '-v'

-- tells SHELL it's the end of options. And disables further option processing. So anything after -- will be treated as filenames.