linux下删除带-号的⽂件不知为何主⽬录下突然多了个-sV⽂件,⽬测是因为nmap的-sV参数产⽣的。
写下来权当做个笔记~
现在来模拟下当时的情况
touch -- -sV
touch ./-sV # 两种都⾏
现在⼯作⽬录底下会产⽣⼀个⽂件名为-sV的⽂件
如果执⾏
rm -sV
会产⽣⼀个错误
rm: invalid option -- 's'
Try 'rm --help' for more information.
linux删除子目录命令
原因是⽆效的参数s
本来打算Google下看看的,结果rm --help就看到答案了
To remove a file whose name starts with a '-', for example '-foo',
use one of these commands:
rm -- -foo
rm ./-foo