![为什么使用 ssh 的 mkdir 不想创建长名称目录?](https://linux22.com/image/150663/%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BD%BF%E7%94%A8%20ssh%20%E7%9A%84%20mkdir%20%E4%B8%8D%E6%83%B3%E5%88%9B%E5%BB%BA%E9%95%BF%E5%90%8D%E7%A7%B0%E7%9B%AE%E5%BD%95%EF%BC%9F%20.png)
两个slackware 14.2系统,ssh是7.9p1。
在本地系统上
mkdir -p -v "I want to create long dir name with spaces"
mkdir: directory 'I want to create long dir name with spaces' created
并且还可以
在远程
ssh remote mkdir -p -v "I want to create long dir name with spaces"
mkdir: created directory 'I'
mkdir: created directory 'want'
mkdir: created directory 'to'
mkdir: created directory 'create'
mkdir: created directory 'long'
mkdir: created directory 'dir'
mkdir: created directory 'name'
mkdir: created directory 'with'
mkdir: created directory 'spaces'
为什么?
我尝试使用 ' 而不是 " 和
ssh remote mkdir -p -v 'I want to create long dir name with spaces'
以 0(成功)退出,但未创建目录
答案1
找到解决方案
ssh remote mkdir -p -v 'I\ want\ to\ create\ long\ dirname\ with\ spaces'
我不明白为什么远程会有所不同,我必须使用\
.