Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get available/free sdcard space in android with adb command

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.

like image 453
Venkatesh Avatar asked Apr 08 '14 20:04

Venkatesh


3 Answers

Use df, as with any Linux distro. Not all Android devices may have it, but it usually seems to be available.

like image 108
CommonsWare Avatar answered Sep 28 '22 23:09

CommonsWare


  1. df: Disk space details.

    adb shell df

  2. du: Disk space used by the specified files and subdirectories.

    adb shell du

  3. df -h: Disk space details in KB/MB format.

    adb shell df -h

  4. du -h: Disk space used by the specified files and subdirectories in KB/MB format.

    adb shell du -h

  5. For specific folder desk space details.

    adb shell df /system

  6. For specific folder and sub-directories desk space details

    adb shell du /system

like image 22
Lava Sangeetham Avatar answered Sep 28 '22 23:09

Lava Sangeetham


df -h to find disk usage and to find big files:

du -a <the_dir> | sort -n -r | head -n 20
like image 45
cieunteung Avatar answered Sep 28 '22 23:09

cieunteung