我知道,有几个字符应该被转义。例如:
$ cd /home/Username\ with\ spaces/Desktop
Run Code Online (Sandbox Code Playgroud)
我知道另一种选择是将它括在单引号中。
$ cd '/home/Username with spaces/Desktop'
Run Code Online (Sandbox Code Playgroud)
有这些字符的完整列表吗?或者任何经验法则?
我希望有一个“完整的清单”。我曾经编译过一个过滤程序,它可以转义我能想到的每个“特殊字符”。
好的开始:!? $ % $ # & * ( ) 空白标签 | '; " < > \ ~ ` [ ] { }
我确定还有其他人我错过了。