Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Nov 14 '13 at 16:12

This question came from our site for professional and enthusiast programmers.

up vote 6 down vote accepted

If you run make -j without any number then it will run as many as it can without limiting to the number you provide.

Linux make man page

share|improve this answer

Run lscpu to get information about your cpu.nproc returns the amount of processors

share|improve this answer

Try this in your terminal :

cat /proc/cpuinfo | grep processor | wc -l
share|improve this answer

@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()'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.