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.
Use df
, as with any Linux distro. Not all Android devices may have it, but it usually seems to be available.
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 -h
查找磁盘使用情况并查找大文件:
du -a <the_dir> | sort -n -r | head -n 20
du | sort -n -r
du | sort -n -r
will mess up the hierarchy of folders, so I prefer -t, --threshold=SIZE
to set a threshold.
But du on my Android phone doesn't have -t, --threshold=SIZE
option
So I found an alternative:
du -m | awk '$1 >= 100'
(Display directories with a size >= 100MB)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.