nproc Command in Linux with Examples

nproc is a simple Unix command which is used to print the number of processing units available in the system or to the current process. This command could be used in system diagnostics and related purposes. It is part of GNU Core utils, so it comes pre-installed with all modern Linux operating systems.
Syntax:

nproc [OPTION]...

Working with nproc Command

1. Use nproc command

nproc

nproc-linux
It prints the number of processing units available to the current process. It may be less than the number of online processors.

2. To print total installed processing units

nproc --all

To-print-total-installed-processing-units
We use the “–all” option when we want nproc to display the total installed processing units.



3. To exclude some processing units

nproc --ignore=4

To-exclude-some-processing-units
We use “–ignore” option when we want nproc to exclude a set number of processing units.

4. To display the help section

nproc --help

nproc-help
This command will display the help section of the nproc command which will have all the information related to the nproc command.

5. To display version

nproc --version

nproc-version
This command will display the version of nproc command in Linux.

6. To display nproc manual

man nproc

nproc-manual
This command will print the manual of the nproc command.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.