如何使用 adb 命令在 android 中获取可用/免费 sdcard 空间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22947690/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get available/free sdcard space in android with adb command
提问by Venkatesh
I am trying to get free sdcard space with adb command, but I could not able to achieve. Any suggestions how to get the sdcard space.
我正在尝试使用 adb 命令获得可用的 sdcard 空间,但我无法实现。任何关于如何获得 SD 卡空间的建议。
回答by CommonsWare
Use df, as with any Linux distro. Not all Android devices may have it, but it usually seems to be available.
使用df,与任何Linux发行版。并非所有 Android 设备都可能拥有它,但它通常似乎可用。
回答by Lava Sangeetham
df: Disk space details.
adb shell df
du: Disk space used by the specified files and subdirectories.
adb shell du
df -h: Disk space details in KB/MB format.
adb shell df -h
du -h: Disk space used by the specified files and subdirectories in KB/MB format.
adb shell du -h
For specific folder desk space details.
adb shell df /system
For specific folder and sub-directories desk space details
adb shell du /system
df:磁盘空间详细信息。
亚行外壳 df
du:指定文件和子目录使用的磁盘空间。
adb shell du
df -h:KB/MB 格式的磁盘空间详细信息。
adb shell df -h
du -h: KB/MB 格式的指定文件和子目录使用的磁盘空间。
adb shell du -h
有关特定文件夹桌面空间的详细信息。
adb shell df /system
有关特定文件夹和子目录桌面空间的详细信息
adb shell du /system
回答by cieunteung
df -hto find disk usage and to find big files:
df -h查找磁盘使用情况并查找大文件:
du -a <the_dir> | sort -n -r | head -n 20

