简体   繁体   English

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

[英]adb shell command - cd: No such file or directory

I use an android 4.0 system on my device, when I use adb shell log in and want to go to the /cache directory with using cd cache, but it just show 当我使用adb shell登录并想使用cd cache转到/ cache目录时,我在设备上使用了android 4.0系统,但它只显示

/system/bin/sh: cd: /cache - No such file or directory / system / bin / sh:cd:/ cache-没有这样的文件或目录

Why? 为什么? I really see the cache use ls command, it shows like 我真的看到缓存使用ls命令,它显示为

lrwxrwxrwx root root 2012-03-12 10:22 cache -> /data/cache" lrwxrwxrwx root root 2012-03-12 10:22 cache-> / data / cache“

Cd to other directory is ok. CD到其他目录也可以。 Has anybody can help me? 有人可以帮助我吗?

Instead of 代替

cd /cache

do

cd /data/cache

or 要么

If you type ls and you see cache, you should type cd cache because cd /cache is a directory just under the root / 如果键入ls并看到cache,则应键入cd cache因为cd /cache是根目录/下的目录/

/cache is a symbolic link to a non-existent directory. /cache是到不存在目录的符号链接。 cd /cache is the same as cd /data/cache . cd /cachecd /data/cache if /data/cache does not exist (which looks to be your problem) you'd get the "No such..." error. 如果/data/cache不存在(这可能是您的问题),则会出现“ No such ...”错误。

Additionally, if you do ls -L /cache you'd get the same "No such..." error; 另外,如果执行ls -L /cache则会出现相同的“ No such ...”错误; that's because the -L option tries to list the target of the link (which does not exist, in this case) instead of the link. 这是因为-L选项尝试列出链接的目标(在这种情况下不存在)而不是链接。

Finally: 最后:

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'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM