android 查看手机存储空间以及文件状态及大小

1,df

df或者df -h

df命令能够输出当前目录文件夹的状态以及大小,-h能够保证大小以kb,Gb等我们能够熟悉的单位进行显示.
输出如下:

Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   960804        64    960740   0% /dev
none                    960804        12    960792   0% /sys/fs/cgroup
tmpfs                   960804         0    960804   0% /mnt/asec
tmpfs                   960804         0    960804   0% /mnt/obb
tmpfs                   960804         0    960804   0% /storage/emulated
/dev/block/platform/mtk-msdc.0/by-name/system
                       2539312   1310780   1212148  52% /system
/dev/block/platform/mtk-msdc.0/by-name/userdata
                      11847384    684928  11129688   6% /data
/dev/block/platform/mtk-msdc.0/by-name/cache
                        420552       424    411448   0% /cache
/dev/block/platform/mtk-msdc.0/by-name/protect1
                          5968        60      5704   1% /protect_f
/dev/block/platform/mtk-msdc.0/by-name/protect2
                          5968        56      5708   1% /protect_s
/dev/block/loop0          1254      1254         0 100% /mnt/cd-rom
/dev/fuse             11796184    684928  11078488   6% /mnt/shell/emulated

或者:

Filesystem                Size      Used Available Use% Mounted on
tmpfs                   938.3M     64.0K    938.2M   0% /dev
none                    938.3M     12.0K    938.3M   0% /sys/fs/cgroup
tmpfs                   938.3M         0    938.3M   0% /mnt/asec
tmpfs                   938.3M         0    938.3M   0% /mnt/obb
tmpfs                   938.3M         0    938.3M   0% /storage/emulated
/dev/block/platform/mtk-msdc.0/by-name/system
                          2.4G      1.3G      1.2G  52% /system
/dev/block/platform/mtk-msdc.0/by-name/userdata
                         11.3G    668.9M     10.6G   6% /data
/dev/block/platform/mtk-msdc.0/by-name/cache
                        410.7M    424.0K    401.8M   0% /cache
/dev/block/platform/mtk-msdc.0/by-name/protect1
                          5.8M     60.0K      5.6M   1% /protect_f
/dev/block/platform/mtk-msdc.0/by-name/protect2
                          5.8M     56.0K      5.6M   1% /protect_s
/dev/block/loop0          1.2M      1.2M         0 100% /mnt/cd-rom
/dev/fuse                11.2G    668.9M     10.6G   6% /mnt/shell/emulated

2,du 查看文件或者文件夹的使用状态.du命令可和sort以及grep,联合使用.
不带参数的du,能够循环列出目录下所有文件的磁盘使用情况.
du -h:查看目录中各文件以及文件夹使用状态

4.0K    ./mcube
4.0K    ./com.mediatek
4.0K    ./com.cci.android
4.0K    ./com.android.backupconfirm
4.0K    ./com.letv.bugpostbox/cache
8.0K    ./com.letv.bugpostbox/files
16.0K   ./com.letv.bugpostbox
4.0K    ./com.mediatek.connectivity
4.0K    ./com.android.providers.calendar/cache
8.0K    ./com.android.providers.calendar/shared_prefs

du -sh:统计目录总计存储大小
du -sm * | sort -n:统计目录中各文件大小并排序:

0   security
0   tinyproxy
0   user
1   letvPreview
2   nvram
3   misc
4   piggybank
5   letvTheme
5   system
13  data
31  app-lib
54  media
547 dalvik-cache
    原文作者:hailushijie
    原文地址: https://blog.csdn.net/hailushijie/article/details/45620921
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞