免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1678 | 回复: 6
打印 上一主题 下一主题

[系统管理] 系统下莫名其妙多出一个目录,删除不掉 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-02-09 21:15 |只看该作者 |倒序浏览
[root@iZ252affh58Z mysql_incremental]# ls -ltr
total 24
drwxr-x--- 4 root root  4096 Feb  3 19:11 -help
-rwxr-xr-x 1 root root  3537 Feb  9 21:05 my_3306_2017-02-09.cnf
-rw-r--r-- 1 root root     0 Feb  9 21:05 xtra_incrementalbak_2017-02-09.tar.gz
-rw-r--r-- 1 root root 14044 Feb  9 21:06 xtra_incrementalbak_2017-02-09.log


[root@iZ252affh58Z mysql_incremental]# cd -help
-bash: cd: -h: invalid option
cd: usage: cd [-L|-P] [dir]

[root@iZ252affh58Z mysql_incremental]# rm -rf -help
rm: invalid option -- 'h'
Try `rm ./-help' to remove the file `-help'.
Try `rm --help' for more information.

请问怎么处理啊,非常感谢

论坛徽章:
0
2 [报告]
发表于 2017-02-09 22:10 |只看该作者
[root@olu73 ~]# ls -l
total 8
-rw-------. 1 root root 1700 Feb  9 21:14 anaconda-ks.cfg
drwxr-xr-x  2 root root    6 Feb  9 22:08 -help
-rw-r--r--. 1 root root  379 Feb  9 21:35 orc.sh
[root@olu73 ~]# rm -rf -help
rm: invalid option -- 'h'
Try 'rm ./-help' to remove the file ‘-help’.
Try 'rm --help' for more information.
[root@olu73 ~]#
[root@olu73 ~]#
[root@olu73 ~]# rm -rf ./'-help'
[root@olu73 ~]# ls -l
total 8
-rw-------. 1 root root 1700 Feb  9 21:14 anaconda-ks.cfg
-rw-r--r--. 1 root root  379 Feb  9 21:35 orc.sh
[root@olu73 ~]#

论坛徽章:
1
2015亚冠之萨济拖拉机
日期:2015-09-04 10:29:22
3 [报告]
发表于 2017-02-10 10:55 |只看该作者
加双引号可以么
手头没有测试环境.

论坛徽章:
0
4 [报告]
发表于 2017-02-10 10:59 |只看该作者
回复 2# 大胖12138


收到,删除了,非常感谢

我系现在有个目录里有~这个文件,但是我感觉它是"家"目录,不干删除呢,有啥办法吗

[root@iZ252affh58Z scripts]# ls -ltr
total 164
-rwxrwxrwx 1 root root   140 Jan 13 20:12 mysql_env.ini
-rwxrwxrwx 1 root root   176 Jan 13 20:16 mysqlplus.sh
-rwxrwxrwx 1 root root  1215 Jan 20 20:14 mysql_full_backup_by_xtra.sh
-rwxr-xr-x 1 root root 21619 Feb  2 21:49 orztop
-rwxrwxrwx 1 root root   111 Feb  3 12:52 orztop.sh
drwxr-xr-x 6 root root  4096 Feb  3 16:52 perlmodule
-rwxr-xr-x 1 root root 56922 Feb  3 17:27 orzdba.pl_backup
-rwxrwxrwx 1 root root 56980 Feb  3 18:17 orzdba.pl
-rw-r--r-- 1 root root  1412 Feb  9 21:02 ~

论坛徽章:
0
5 [报告]
发表于 2017-02-10 11:05 |只看该作者
回复 3# tolilong

按照上面的大哥的办法解决了。

论坛徽章:
1
2015亚冠之萨济拖拉机
日期:2015-09-04 10:29:22
6 [报告]
发表于 2017-02-10 11:14 |只看该作者
回复 5# hello130

恩恩,
就想知道下,使用双引号是不是也可以。。。

论坛徽章:
0
7 [报告]
发表于 2017-02-10 13:53 |只看该作者
本帖最后由 大胖12138 于 2017-02-10 13:55 编辑

#mkdir -pv ./"-help"
mkdir: created directory ‘./-help’
#ls -l
-rw-------. 1 root root 1711 Jan 23 15:21 anaconda-ks.cfg
drwxr-xr-x  2 root root    6 Feb 10 13:51 -help
#rm -rf ./"-help"
#ls -l
-rw-------. 1 root root 1711 Jan 23 15:21 anaconda-ks.cfg
#
单引号忽略所有特殊字符,双引号忽略大多数,但不包括  $  \  `
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP