Sample Header Ad - 728x90

how to get number of total core include thread

3 votes
1 answer
3681 views
as all know lscpu give the info about number of CORE and number of Thread lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 48 On-line CPU(s) list: 0-47 Thread(s) per core: 2 I am searching about command that can give the total as ( number of CORE ) X ( number of Thread ) = 96 so output will be as case above = 96 CPU we can do as CORE= nproc --all THREAD= lscpu | grep -i Thread | awk '{print $NF}' and echo "$(( $CORE*$THREAD ))" but this isn't elegant way or maybe other elegant approach ? we try also this ( but not get the total 96 cores's ) num_cpus=$(nproc) # echo $num_cpus 48
Asked by yael (13936 rep)
Aug 12, 2019, 10:39 PM
Last activity: Aug 13, 2019, 04:57 AM