Skip to content

Instantly share code, notes, and snippets.

@narutaro
Last active December 23, 2015 01:19
Show Gist options
  • Save narutaro/e40d36634aabaa268da8 to your computer and use it in GitHub Desktop.
Save narutaro/e40d36634aabaa268da8 to your computer and use it in GitHub Desktop.
How to delete a file starting with hyphen

#How to delete a file starting with - or --

##NO.1 - NG

$ rm '--attack_metadata'
rm: unrecognized option '--attack_metadata'
Try 'rm ./--attack_metadata' to remove the file ‘--attack_metadata’.
Try 'rm --help' for more information.

##NO.2 - NG

$ rm *attack_metadata
rm: unrecognized option '--attack_metadata'
Try 'rm ./--attack_metadata' to remove the file ‘--attack_metadata’.
Try 'rm --help' for more information.

##NO.3 - OK!

rm ./--attack_metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment