Friday, 1 December 2017

How to check processors/cores, memory and disk space using single command ?


Single command to check Processors/cores, Memory and Disk space


# echo "Processor : $(grep "processor" /proc/cpuinfo | wc -l)" && grep "cpu cores" /proc/cpuinfo | awk -F: '{num+=$2} END {print "Cores     :", num}' && echo "Memory    : $(head -1 /proc/meminfo | awk '{print $2}') KB" && echo "$(fdisk -l | grep "Disk /dev" | grep -v "mapper" | awk '{num+=$3} END {print "Disk      :", num}') GB"



Processor : 4
Cores     : 4
Memory    : 8011500 KB
Disk      : 375.8 GB

No comments:

Post a Comment

Note: only a member of this blog may post a comment.