-1

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.
asked Jun 8, 2023 at 2:52
2
  • Try rm \-v.., Commented Jun 8, 2023 at 2:54
  • Not a programming question; Unix & Linux? Super User? Commented Jun 8, 2023 at 3:16

1 Answer 1

0

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.

answered Jun 8, 2023 at 3:17
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.