diff --git a/rm/delete_files_with_names_resembling_cli_options.md b/rm/delete_files_with_names_resembling_cli_options.md index 0da826b..698ef07 100644 --- a/rm/delete_files_with_names_resembling_cli_options.md +++ b/rm/delete_files_with_names_resembling_cli_options.md @@ -2,12 +2,18 @@ I have been accomplishing this by using **Perl's** `unlink`, but there is a much simpler solution as pointed out to me by @larsbalker via Twitter. -Use: `--`, which terminates the interpretation of command line flags/options +If you by accident create a file named: `-v` use: `--`, which terminates the interpretation of command line flags/options `$ rm -- -v` Thanks @larsbalker +The Perl solution is: + +```perl +perl -e "unlink '-v'"; +``` + ## References - [Twitter](https://twitter.com/jonasbn/status/966336534835269637)