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

javascript - How to process users in one specific order using map o each function? -

javascript - Linking from page A to a specific iframe on page B -

java - Two interface have same method name with different return type -