• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods Directory size

  • Thread starter Thread starter Valiceemo
  • Start date Start date
V

Valiceemo

Guest
I'm trying to write a script to check the size of a directory on my sdcard. Playing around in terminal emulator I can't figure it out.
With this command.
du -h /storage/sdcard/backups

I get an error saying.
usage: du [-H | -L | -P] [-a | -d depth | -s] [-cgkmrx] [file ...

If I use -H
It gives me an output but it doesn't correlate with what's in the folder?

Am I doing something wrong?

Sent from my LG-D802 using Tapatalk
 
Evidently your busybox doesn't support -h (make human readable), only -H (dereference only symlinks that are listed on the command line). Try it without the -H. (BTY, du isn't "list exact size", it's "estimate size".)

Any time you have a problem with a Linux command, read the manpage (you can google manpage for any command).
 
Evidently your busybox doesn't support -h (make human readable), only -H (dereference only symlinks that are listed on the command line). Try it without the -H. (BTY, du isn't "list exact size", it's "estimate size".)

Any time you have a problem with a Linux command, read the manpage (you can google manpage for any command).

Thanks. Is there a command for exact size?
 
Back
Top Bottom