加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – 如何删除名称以’ – ‘开头的文件[复制]

发布时间:2020-12-16 01:07:28 所属栏目:安全 来源:网络整理
导读:参见英文答案 How to remove files starting with double hyphen?7个 rm cannot delete files starting with — 3个 在脚本出错后,我最终得到了一个名称以短划线’ – ‘开头的文件 -myfile.txt 我到目前为止尝试过: rm -myfile.txtrm: illegal option -- m
参见英文答案 > How to remove files starting with double hyphen?7个
> rm cannot delete files starting with — 3个
在脚本出错后,我最终得到了一个名称以短划线’ – ‘开头的文件

-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

你有什么主意吗 ?

谢谢

感谢@ ajp15243:
答案是 :
rm ./-myfile.txt

要么

rm -- -myfile.txt

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读