无法使用Linux删除$符号命名文件?

萨尔玛

这是我的ls命令,它显示当前目录中的文件列表:

rper:  ls -l

$commandoutput[0]  
file.txt

我尝试$commandoutput[0]通过使用删除rm -rf $commandoutput[0],但显示以下错误。我该如何删除?

rper: rm -rd $commandoutput[0]
commandoutput: Undefined variable.
罗曼·佩列赫雷斯特

使用反斜杠转义$(最好[])登录文件名\

rm -rf \$commandoutput\[0\]

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章