I am using DU
function to output the directory size to a file and then move it to an excel file to add the total. Is it possible to output the size of a directory only in MB (even if the size is in KB or GB):
e.g. if the file size is 50kb the output would show 0.048MB
I'm aware of du -h
however I haven't been able to maintain the size in MBs if the size is larger than 1024, since it's switches to 1G.
The du -m
however does not show the M (for megabytes) next to the value so isn't really human friendly.
Thanks in advance, J