unix - Bash- Converting a variable to human readable format (KB, MB, GB) -


in bash script, run through list of directories , read in size of each directory variable using du command. keep running total of total size of directories. problem after total size, it's in unreadable format (ex. 64827120). how can convert variable containing number gbs, mbs, etc?

you want use du -h gives 'human readable' output ie kb, mb, gb, etc.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -