til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

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