How many cores do I have in my machine?
8,229
Solution 1
If you run make -j
without any number then it will run as many as it can without limiting to the number you provide.
Solution 2
Run lscpu
to get information about your cpu.nproc
returns the amount of processors
Solution 3
Try this in your terminal :
cat /proc/cpuinfo | grep processor | wc -l
Solution 4
@BuysDB definitely has the simplest solution that directly answers the question, but here's another, more cross platform way to do it assuming python is installed:
python -c 'import multiprocessing as mp; print mp.cpu_count()'
Related videos on Youtube
Author by
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
I want to install a relatively huge package on my Ubuntu 13.10 and I want to use all of the processing cores of my machine. I type
make -j N
where
N
is the number of available cores+1, I guess. But the problem is that I don't know how many cores do I have. How can I figure it out in Ubuntu?