xref: /freebsd/bin/nproc/nproc.1 (revision 3c4ba5f55438f7afd4f4b0b56f88f2bb505fd6a6)
1.\"-
2.\" * Copyright (c) 2023 Piotr Paweł Stefaniak
3.\"
4.\" * SPDX-License-Identifier: BSD-2-Clause
5.\"
6.Dd February 15, 2023
7.Dt NPROC 1
8.Os
9.Sh NAME
10.Nm nproc
11.Nd print the number of processors
12.Sh SYNOPSIS
13.Nm
14.Op Fl -all
15.Op Fl -ignore Ns = Ns Ar count
16.Nm Fl -help
17.Nm Fl -version
18.Sh DESCRIPTION
19The
20.Nm
21utility is used to print the number of processors limited to the
22.Xr cpuset 2
23of the current process, unless the
24.Fl -all
25flag is specified.
26.Pp
27The available flags are:
28.Bl -tag -width Ds
29.It Fl -all
30Count all processors currently online.
31.It Fl -ignore Ns = Ns Ar count
32The result is decreased by
33.Ar count ,
34but never below 1.
35.It Fl -version
36Print the current program version and exit.
37Do not use this option.
38.It Fl -help
39Print usage information and exit.
40.El
41.Sh COMPATIBILITY
42This program is intended to be compatible with nproc as found in GNU coreutils.
43.Sh BUGS
44If HyperThreading is enabled in BIOS and disabled in the kernel, the
45.Fl -all
46option on Linux will still report all possible CPU threads.
47On FreeBSD only active threads will be reported.
48.Sh SEE ALSO
49.Xr cpuset 1
50.Sh HISTORY
51The
52.Nm
53utility first appeared in
54.Fx 14.0 .
55.Sh AUTHORS
56.An -nosplit
57.An Mateusz Guzik Aq Mt mjg@FreeBSD.org
58wrote the program and
59.An Piotr Paweł Stefaniak Aq Mt pstef@FreeBSD.org
60wrote this page.
61