This will convert any kB
lines to MB
:
1 | awk '$3=="kB"{$2=$2/1024;$3="MB"} 1' /proc/meminfo | column -t |
This version converts to gigabytes:
1 | awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' /proc/meminfo | column -t |
For completeness, this will convert to MB or GB as appropriate:
1 | awk '$3=="kB"{if ($2>1024^2){$2=$2/1024^2;$3="GB";} else if ($2>1024){$2=$2/1024;$3="MB";}} 1' /proc/meminfo | column -t |
Recent Posts
Recent Comments
- LogixTree Networks on Localhost showing “Index/of” instead of displaying the Website
- AMANUR RAHMAN on Localhost showing “Index/of” instead of displaying the Website
- Christy on Support Purchase Notes in Order Emails WooCommerce
- LogixTree Networks on Localhost showing “Index/of” instead of displaying the Website
- Sofia on Localhost showing “Index/of” instead of displaying the Website