无法使用 CD 命令访问某些目录

无法使用 CD 命令访问某些目录

无法访问加拿大太平洋伙伴关系协定目录。

ashutosh@ashutosh:~$ ls
17431- Microprocessor and Programming.pdf  Documents       Softbox
17431.pdf                                  Downloads       TASM
ANURAG                                     geany           TASM 
Ashu's Books                               Movies & More   untitled.html
Audiobooks                                 Music           Videos
CPP                                        Pictures        VirtualBox VMs
Desktop                                    Public          vmware
ashutosh@ashutosh:~$ cd CPP
bash: cd: CPP: No such file or directory
ashutosh@ashutosh:~$ 

为了 :-ls-la

total 1360
drwxr-xr-x 48 ashutosh ashutosh   4096 Jan 23 11:54 .
drwxr-xr-x  3 root     root       4096 Jan 14 15:38 ..
-rw-r--r--  1 ashutosh ashutosh  78197 Jan 10 15:48 17431- Microprocessor and Programming.pdf
-rw-r--r--  1 ashutosh ashutosh 970448 Jan 10 15:50 17431.pdf
drwx------  3 ashutosh ashutosh   4096 Jan 14 19:30 .adobe
drwx------ 15 ashutosh ashutosh   4096 Jan 14 15:49 ANURAG
drwx------ 25 ashutosh ashutosh   4096 Jan 21 21:33 Ashu's Books
drwxrwxr-x  2 ashutosh ashutosh   4096 Jan 18 16:49 Audiobooks
-rw-------  1 ashutosh ashutosh  10545 Jan 23 11:52 .bash_history
-rw-r--r--  1 ashutosh ashutosh    220 Jan 14 15:38 .bash_logout
-rw-r--r--  1 ashutosh ashutosh   3637 Jan 14 15:38 .bashrc
drwx------ 33 ashutosh ashutosh   4096 Jan 23 11:54 .cache
drwx------  3 ashutosh ashutosh   4096 Jan 19 13:08 .calcurse
drwxrwxr-x  5 ashutosh ashutosh   4096 Jan 23 10:53 .cinnamon
drwx------  3 ashutosh ashutosh   4096 Jan 14 17:32 .compiz
drwx------ 42 ashutosh ashutosh   4096 Jan 23 11:54 .config
drwxr-xr-x  9 ashutosh ashutosh   4096 Jan 18 21:22 .conky
drwxr-xr-x  2 ashutosh ashutosh   4096 Jan 22 15:32 CPP 
drwx------  3 ashutosh ashutosh   4096 Jan 14 18:48 .dbus
drwxr-xr-x  2 ashutosh ashutosh   4096 Jan 22 18:40 Desktop
-rw-------  1 ashutosh ashutosh     42 Jan 23 10:53 .dmrc
drwxr-xr-x  5 ashutosh ashutosh   4096 Jan 18 21:17 Documents
drwxr-xr-x  3 ashutosh ashutosh   4096 Jan 23 11:56 Downloads
-rw-r--r--  1 ashutosh ashutosh   6137 Jan 18 16:29 .face
drwxr-xr-x  2 ashutosh ashutosh   4096 Jan 18 21:20 .fonts
drwx------  3 ashutosh ashutosh   4096 Jan 23 11:36 .gconf
drwxr-xr-x  3 ashutosh ashutosh   4096 Jan 18 21:17 geany
drwxr-xr-x 24 root     root       4096 Jan 20 18:39 .gimp-2.8
-rw-r-----  1 ashutosh ashutosh      0 Jan 23 11:53 .gksu.lock
drwx------  3 ashutosh ashutosh   4096 Jan 23 11:54 .gnome
drwxr-xr-x  4 ashutosh ashutosh   4096 Jan 19 19:26 .gnome2
drwx------  2 ashutosh ashutosh   4096 Jan 18 15:59 .gnome2_private
drwxr-xr-x  2 ashutosh ashutosh   4096 Jan 19 14:09 .gstreamer-0.10
drwx------  2 root     root       4096 Jan 20 10:22 .gvfs
-rw-------  1 ashutosh ashutosh  16634 Jan 23 10:53 .ICEauthority
drwxrwxr-x  2 ashutosh ashutosh   4096 Jan 14 18:49 .icons
drwxr-xr-x  3 ashutosh ashutosh   4096 Jan 14 15:43 .local
-rw-rw-r--  1 ashutosh ashutosh     80 Jan 15 22:18 .~lock.Completedall .pptx#
-rw-rw-r--  1 ashutosh ashutosh     80 Jan 15 21:54 .~lock.The Final Report .pptx#
drwx------  3 ashutosh ashutosh   4096 Jan 14 19:30 .macromedia
drwx------  3 ashutosh ashutosh   4096 Jan 19 14:13 .moc
drwx------  4 ashutosh ashutosh   4096 Jan 21 13:02 Movies & More 
drwx------  4 ashutosh ashutosh   4096 Jan 14 15:54 .mozilla
drwxrwxr-x  2 ashutosh ashutosh   4096 Jan 14 16:57 .mplayer
drwxr-xr-x  3 ashutosh ashutosh   4096 Jan 14 16:18 Music
-rw-r--r--  1 ashutosh ashutosh    374 Jan 18 12:14 .nvidia-settings-rc
drwxr-xr-x  4 ashutosh ashutosh   4096 Jan 21 21:13 Pictures
drwx------  3 ashutosh ashutosh   4096 Jan 23 11:54 .pki
-rw-r--r--  1 ashutosh ashutosh     31 Jan 19 19:20 .plymouth-manager.cf
-rw-r--r--  1 ashutosh ashutosh    196 Jan 19 19:20 .PMtheme.plymouth
-rw-r--r--  1 ashutosh ashutosh    196 Jan 19 19:20 .PMtheme.script
-rw-r--r--  1 ashutosh ashutosh    675 Jan 14 15:38 .profile
drwxr-xr-x  3 ashutosh ashutosh   4096 Jan 18 16:56 Public
drwx------  2 ashutosh ashutosh   4096 Jan 20 19:13 .remmina
drwx------ 11 ashutosh ashutosh   4096 Jan 21 21:31 Softbox
drwxr-xr-x  2 ashutosh ashutosh   4096 Jan 22 10:40 TASM
drwx------  2 ashutosh ashutosh   4096 Jan 22 13:28 TASM 
drwxrwxr-x  8 ashutosh ashutosh   4096 Jan 18 21:10 .themes
drwx------  4 ashutosh ashutosh   4096 Jan 16 09:16 .thumbnails
-rw-r--r--  1 ashutosh ashutosh    127 Jan 21 21:51 untitled.html
drwxr-xr-x  3 ashutosh ashutosh   4096 Jan 14 15:58 Videos
drwxrwxr-x  3 ashutosh ashutosh   4096 Jan 22 11:40 VirtualBox VMs
drwxr-xr-x  4 ashutosh ashutosh   4096 Jan 22 11:24 vmware
drwxr-xr-x  2 ashutosh ashutosh   4096 Jan 22 18:46 .vmware
drwxr-xr-x  4 ashutosh ashutosh   4096 Jan 22 13:26 .wine
-rw-------  1 ashutosh ashutosh    119 Jan 23 10:53 .Xauthority
-rw-r--r--  1 ashutosh ashutosh  38086 Jan 23 11:56 .xsession-errors
-rw-------  1 ashutosh ashutosh   1067 Jan 17 12:01 .xsession-errors.old

答案1

我的猜测是目录名称中有一个空格字符(或类似的字符)。

为了验证这一点,请尝试输入cd CPP<tab>并查看 shell 是否自动完成它,cd CPP\ /这意味着目录名以空格字符结尾。

验证该假设的另一种方法是通过运行查看 ls 命令输出的十六进制转储ls | hd(如果您仍然无法使其工作,可以向我们展示)。

相关内容