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