RM无法删除文件开头 - [英] rm cannot delete files starting with --

查看:195
本文介绍了RM无法删除文件开头 - 的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个创建的文件,有时他们最终在一开始有2破折号的脚本,有没有办法将其删除MV无法正常工作或

下面是我得到的错误

  $ LS
 --1355509766.jpg$ RM --1355509766.jpg
RM:非法选项 - -
用法:RM [-f | -i] [-dPRrvW]文件...
   取消链接文件$ RM--1355509766.jpg
RM:非法选项 - -
用法:RM [-f | -i] [-dPRrvW]文件...
   取消链接文件


解决方案

惯用的伎俩是

  RM ./--1355509766.jpg

更新:这里是男人RM 不得不说的是:

要删除其名称以a开头的文件' - ',例如'-foo',用
这些命令之一:       RM - -foo       RM ./-foo

I have a script that creates files and sometimes they end up having 2 dashes at the beginning, is there any way to delete them mv doesn't work either

Here is the error I am getting

$ ls
 --1355509766.jpg

$ rm --1355509766.jpg 
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
   unlink file

$ rm "--1355509766.jpg"
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
   unlink file

解决方案

The usual trick is

rm ./--1355509766.jpg

Update: here's what man rm has to say about this:

To  remove a file whose name starts with a '-', for example '-foo', use
one of these commands:

       rm -- -foo

       rm ./-foo

这篇关于RM无法删除文件开头 - 的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆