Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 495 Bytes

delete_files_with_names_resembling_cli_options.md

File metadata and controls

19 lines (11 loc) · 495 Bytes

Delete files with_names resembling cli options

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.

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 -e "unlink '-v'"

References