هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
nproc prints how many processing units are available — limited by CPU affinity and cgroup settings. Use it to compare with the load average, or to choose the number of parallel jobs.
طريقة الكتابة
nproc [OPTION]...الخيارات 4
الأكثر استخدامًا
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Number of CPUs
nproc 2Usable now.
2All installed CPUs
nproc --all 4More than nproc = some are limited (affinity, cgroup, offline).
3Parallel build
make -j"$(nproc)"One job per core.
4Keep one core free
make -j"$(nproc --ignore=1)"The system stays usable.
5Compare with the load
uptime; nprocLoad above nproc = processes wait.
6Parallel compression
xz -T"$(nproc)" big.tarAll cores.
7In a container with a CPU limit
podman run --rm --cpuset-cpus=0 registry.access.redhat.com/ubi10/ubi nproc 1Containers see the limit.
8Limit a command to 2 CPUs
taskset -c 0,1 nproc 2CPU affinity changes the result.
9More details
Sockets, cores and threads.
10Script sizing
WORKERS=$(( $(nproc) * 2 )); echo $WORKERSA common rule for web workers.
لا يوجد شيء يطابق هذا الفلتر.
رموز الخروج
0 :: Done. 1 :: Error.