Cron Debian+;删除以开头的文件*

Cron Debian+;删除以开头的文件*,cron,debian,Cron,Debian,我已经设置了一个cronjob来删除每小时由另一个脚本生成的文件 文件名:inc.php?cronUsers 我当前的命令如下所示: rm -f "/root/inc.php?cronUsers" 问题是,当存在多个文件时,文件名会发生如下更改: rm -f "/root/inc.php?cronUsers" inc.php?cronUsers.1,inc.php?cronUsers.2等等 我对这一切都很陌生,所以唯一幸运的猜测是: rm -f "/root/inc.php?cronUse

我已经设置了一个cronjob来删除每小时由另一个脚本生成的文件

文件名:
inc.php?cronUsers

我当前的命令如下所示:

rm -f "/root/inc.php?cronUsers"
问题是,当存在多个文件时,文件名会发生如下更改:

rm -f "/root/inc.php?cronUsers"
inc.php?cronUsers.1
inc.php?cronUsers.2
等等

我对这一切都很陌生,所以唯一幸运的猜测是:

rm -f "/root/inc.php?cronUsers.*"
但这似乎不起作用


否则,我如何删除所有以
inc.php?cronUsers

rm-f inc.php \?cronUsers开头的文件*

似乎有效:

$ touch "inc.php?cronUsers.1"
$ touch "inc.php?cronUsers.2"
$ touch "inc.php?cronUsers"
$ ls
inc.php?cronUsers  inc.php?cronUsers.1  inc.php?cronUsers.2
$ rm -f inc.php\?cronUsers*
$ ls
<empty> :)
$touch“inc.php?cronUsers.1”
$touch“inc.php?cronUsers.2”
$touch“inc.php?cronUsers”
$ls
inc.php?cronUsers inc.php?cronUsers.1 inc.php?cronUsers.2
$rm-f inc.php\?cronUsers*
$ls
:)
问候


(为什么你把你的问题标题写成“那以*”?“我错过了什么吗?”

有效:)我有点想知道为什么这个有效,
rm-f”/root/inc.php?cronUsers.*“
没有,但现在真的没关系:)关于标题:没有。。我只是想表达一下,我试图删除的文件有不同的名称……我想我并没有真正成功地做到这一点:/为什么会有人投票来结束这个问题??你能解释一下我做错了什么吗?