Linux 更改为名称中带有空格的目录

Linux 更改为名称中带有空格的目录,linux,bash,Linux,Bash,问这个问题很傻,但似乎无法将目录更改为WindowsXPIE7。请看下面我所做的尝试 [root@localhost VirtualBox VMs]# ls -l total 8 drwxr-xr-x 4 justMe justMe 4096 Dec 19 07:20 Windows XP IE6 drwxr-xr-x 4 justMe justMe 4096 Dec 19 06:48 Windows XP IE7 [root@localhost VirtualBox VMs]# cd Wind

问这个问题很傻,但似乎无法将目录更改为
WindowsXPIE7
。请看下面我所做的尝试

[root@localhost VirtualBox VMs]# ls -l
total 8
drwxr-xr-x 4 justMe justMe 4096 Dec 19 07:20 Windows XP IE6
drwxr-xr-x 4 justMe justMe 4096 Dec 19 06:48 Windows XP IE7
[root@localhost VirtualBox VMs]# cd Windows XP IE6
-bash: cd: Windows: No such file or directory
[root@localhost VirtualBox VMs]# cd Win*
[root@localhost Windows XP IE6]# ls -l
total 3558896
drwx------ 2 justMe justMe       4096 Dec 19 07:20 Logs
drwx------ 2 justMe justMe       4096 Dec 19 07:20 Snapshots
-rw------- 1 justMe justMe      18529 Dec 19 07:20 Windows XP IE6.vbox
-rw------- 1 justMe justMe      18586 Dec 19 07:20 Windows XP IE6.vbox-prev
-rw------- 1 justMe justMe 3640700928 Jul 24 12:03 Windows XP IE6.vdi
[root@localhost Windows XP IE6]#
在Bash中,您必须命令包含空格的参数

这就是为什么避免这种空白是个好主意的原因之一

你需要:

$ cd "Windows XP IE6"
在Bash中,您必须命令包含空格的参数

这就是为什么避免这种空白是个好主意的原因之一

你需要:

$ cd "Windows XP IE6"

是的,我觉得很傻!谢谢,另一种选择是使用反斜杠来转义空格:
cd-Windows\XP\IE6
按钮是你的朋友是bash,它会自动完成。是的,我觉得很傻!感谢另一种选择是使用反斜杠来转义空格:
cd-Windows\XP\IE6
按钮是您的朋友是bash,它将自动完成。