How to find no.of cpu cores in Linux:
Option-1
cat /proc/cpuinfo | grep -i processor | wc -l
(or)
grep -c ^processor /proc/cpuinfo
Option-2
nproc
Option-3
lscpu
(or)
lscpu | grep 'CPU(s):' | head -1 | awk '{print $2}'
Option-1
cat /proc/cpuinfo | grep -i processor | wc -l
(or)
grep -c ^processor /proc/cpuinfo
Option-2
nproc
Option-3
lscpu
(or)
lscpu | grep 'CPU(s):' | head -1 | awk '{print $2}'
No comments:
Post a Comment