No such file or directory when 'cp' but not with 'ls'

痞子三分冷 提交于 2020-01-07 16:58:06

问题


I am trying to copy the shared preferences folder of my app to the /sdcard partition from my PC using the following ADB command:

adb shell su -c "cp /data/data/com.anrapps.pixelbatterysaver/shared_prefs/ /sdcard/appdata/"

But this returns cp: Skipped dir '/data/data/com.anrapps.pixelbatterysaver/shared_prefs': No such file or directory. However when executing the ls command, it says that folder is present:

adb shell su -c "ls /data/data/com.anrapps.pixelbatterysaver"

cache code_cache files shared_prefs

What is the problem? May be permission related?


回答1:


If you're trying to copy a whole directory, you need to use cp -r to make it a recursive copy.



来源:https://stackoverflow.com/questions/39961621/no-such-file-or-directory-when-cp-but-not-with-ls

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!