From c80307d28865c9e3fc337e9364afa05992a17d22 Mon Sep 17 00:00:00 2001 From: jonasbn Date: Fri, 9 Aug 2024 13:35:32 +0200 Subject: [PATCH] Added some more notes, so the TIL is more complete. --- rm/delete_files_with_names_resembling_cli_options.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)