小智 5
使用引号将文件名括起来:
rm "file with a space.txt"
Run Code Online (Sandbox Code Playgroud)
更新:使用引号将整个文件路径括起来:
rm "../dir with spaces/file with spaces.txt"
Run Code Online (Sandbox Code Playgroud)
引号告诉 shell 命令将带引号的字符串解释为一个参数(因此您可以在大多数 shell 命令中使用它)。