【问题标题】:adb shell command - cd: No such file or directoryadb shell 命令 - cd: 没有这样的文件或目录
【发布时间】:2012-03-13 01:36:01
【问题描述】:

我在我的设备上使用的是 android 4.0 系统,当我使用 adb shell 登录并想使用 cd 缓存进入 /cache 目录时,它只是显示

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

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

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

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

【问题讨论】:

    标签: android linux shell


    【解决方案1】:

    而不是

    cd /cache
    

    cd /data/cache
    

    如果您键入ls 并看到缓存,则应键入cd cache,因为cd /cache 是根目录/ 下的一个目录

    【讨论】:

      【解决方案2】:

      /cache 是指向不存在目录的符号链接。 cd /cachecd /data/cache 相同。如果/data/cache 不存在(这看起来是您的问题),您将收到“No such...”错误。

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

      最后:

      ln -s this_directory_almost_certainly_does_not_exist not_sure_if_this_exists 测试 -f not_sure_if_this_exists || echo '不,它不存在'

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-05-17
        • 1970-01-01
        • 2021-01-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多