更改为名称中包含空格的目录

时间:2012-12-19 15:44:01

标签: linux bash

感到愚蠢地问这个问题,但似乎无法将目录更改为Windows XP IE7。请参阅下面的内容。

[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]#

1 个答案:

答案 0 :(得分:5)

在Bash中,您必须quote命令在其中包含空格的参数。

这就是避免这样的空白是一个好主意的一个原因。

你需要:

$ cd "Windows XP IE6"
相关问题