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
Post a Comment