This is a nifty small feature . Tools like ps,df,du, ls,ps,size,prstat and swap have now the option --scale. This makes the output of those tools much more readable.
Let’s assume we have a directory with three files of varying size:
This is a little cumbersome to read despite the experienced admin will recognize at least two numbers. The --scale command allows me to control how the output is scaled in a more human readable format.
Let’s at first use a scaling factor of 1024. Values are scaled by dividing by 1024. how often is controlled by the min i have put in front of the 1024. I will later explain the impact off this value.
Of course you could scale with a factor of 1000 as well.
If you chose binary scaling, the Unit will be appended with an “i” to make clear that we are talking about Mebibyte oder Kibibyte.
The unit to which the the numbers are scaled by dividing with the scale factor is set with min, max or minwide.
Min will scale each value to the minimal unit that allows the system to display a value in 5 digits.
max uses the highest unit that allows the to have a nonzero value in front of a possible decimal. It tries to make the number in front of the unit as low as possible and tries to fit in 5 digits.
minwide is similar to min,except that it tries to fit the the size output in eight instead of five columns
This is a nice demonstration of minimal scaling, as the size of testfile fits in eight columns without scaling the value isn’t scaled at all.
You can use --scale as well with prstat
du is one additional tool that supports this option:
As i had quite a fight with a larger IKEA PAX closet for my bedroom, i hadn't quite the time to complete the ZFS retention article so far. Thus today a small...
Another rather small change that was introduces to Solaris 11 in SRU 66. Up to SRU65 the precision of the timestamps in the logfile was seconds.
Jul 5...
Yet another small addition to Solaris 11.4. This one was released with SRU 57. `reboot`, `shutdown` and `poweroff` got a new option. With `-c` you can now s...