Pages

Linux : Showing Processor Type, Memory Size, Total Disk Space

Anyway, to cut a long story short, I got documentation that needs to be submitted which is to get the info of the processor type, memory info and storage size for Linux machines. 

A bunch of information will be displayed if we only used lscpu, meminfo and df command. To make life easier, below are the straightforward command to get that information.

Checking for processor type.

(1) lscpu | grep "Model name"


Checking memory info using grep command.
(Global Regular Expression Print)

(2) grep MemTotal /proc/meminfo | numfmt --field 2 --from-unit=Ki --to-unit=Mi | sed 's/ kB/M/g'

(3) grep MemTotal /proc/meminfo | numfmt --field 2 --from-unit=Ki --to=iec | sed 's/ kB//g'

(4) grep MemTotal /proc/meminfo | numfmt --field 2 --from-unit=Ki --to-unit=Gi | sed 's/ kB/G/g'


Checking memory info using awk command.
(Aho, Weinberger, Kernighan (authors))


(5) awk '$3=="kB"{$2=$2/1024;$3="MB"} 1' /proc/meminfo | column -t | grep MemTotal

(6) awk '$3=="kB"{$2=$2/1024^2;$3="GB";} 1' /proc/meminfo | column -t | grep MemTotal


Checking Store Size

(7) df --total -h




If there is any detailed explanation, just let me know in the comment below. Thanks.


No comments:

Post a Comment

You might also like:

  • CMD Change Windows Vista Product Key After Install
    CMD Change Windows Vista Product Key After Install

    To change Windows Vista product key using…

  • Registry editing has been disabled by your administrator
    Registry editing has been disabled by your administrator

    Simplest solution for it; Click Start >>…

  • How to Decide Whether to Upgrade to Windows 7
    How to Decide Whether to Upgrade to Windows 7

    Just download, install, and run the Windows 7…

  • Zimbra Unable to determine enabled services from LDAP
    Zimbra Unable to determine enabled services from LDAP

    [zimbra@host]$ zmcontrol start Host…

Popular Posts