2012-12-19 30 views
0

感覺這個問題很愚蠢,但似乎無法將目錄更改爲Windows XP IE7。請參閱下面的我嘗試過的內容。更改爲名稱中帶空格的目錄

[[email protected] 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 
[[email protected] VirtualBox VMs]# cd Windows XP IE6 
-bash: cd: Windows: No such file or directory 
[[email protected] VirtualBox VMs]# cd Win* 
[[email protected] 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 
[[email protected] Windows XP IE6]# 

回答

5

在Bash中,您必須有quote命令參數,其中有空格。

這就是爲什麼要避免這種空白是個好主意的原因之一。

您需要:

$ cd "Windows XP IE6" 
+0

是的,我覺得很傻!謝謝 – user1032531

+4

替代方案是使用反斜槓來轉義空格: 'cd Windows \ XP \ IE6' – 2012-12-19 15:46:02

+3

按鈕是你的朋友bash,它會自動完成。 – Scott