在腳本中我結束了他的名字用破折號開頭的文件弄錯後「 - 」如何刪除其名稱以開頭的文件「 - 」
-myfile.txt
我試過到目前爲止:
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
你有什麼想法嗎?
感謝
__FAQ__:'RM - filename' – devnull
可能重複[這裏](https://stackoverflow.com/questions/13917714/rm-cannot-delete-files-starting-with)和[這裏](HTTPS://計算器.com/questions/706196/how-to-remove-files-starting-with-double-hyphen) – ajp15243
thanks @ ajp15243。搜索 – jrjc