adb shell命令 - cd:没有这样的文件或目录

时间:2012-03-13 01:36:01

标签: android linux shell

我在我的设备上使用了android 4.0系统,当我使用adb shell登录并希望使用cd cache转到/ cache目录时,它只是显示

  

/ system / bin / sh:cd:/ cache - 没有这样的文件或目录

为什么呢?我真的看到缓存使用ls命令,它显示为

  

lrwxrwxrwx root root 2012-03-12 10:22 cache - > /数据/缓存“

cd到其他目录就可以了。有人可以帮帮我吗?

2 个答案:

答案 0 :(得分:3)

而不是

cd /cache

DO

cd /data/cache

如果您输入ls并看到缓存,则应键入cd cache,因为cd /cache是根/

下的目录

答案 1 :(得分:0)

/cache是指向不存在的目录的符号链接。 cd /cachecd /data/cache相同。如果/data/cache不存在(看起来是你的问题),你会得到“没有这样......”的错误。

此外,如果你执行ls -L /cache,你会得到相同的“没有......”错误;那是因为-L选项试图列出链接的目标(在这种情况下不存在),而不是链接。

最后:

ln -s  this_directory_almost_certainly_does_not_exist   not_sure_if_this_exists
test -f not_sure_if_this_exists || echo 'Nope, it does not exist'