After a mistake in a script I ended up with a file whose name starts with a dash, -
:
-myfile.txt
I tried so far:
rm -myfile.txt
rm: illegal option -- m
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
rm "-myfile.txt"
rm: illegal option -- m
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
rm "\-myfile.txt"
rm: \-myfile.txt: No such file or directory
rm \-myfile.txt
rm: illegal option -- m
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
rm "-"myfile.txt
rm: illegal option -- m
usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
How can I delete this file?
rm -- filename
– Arcograph