Linux command
nice 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run with lower priority
nice [command]
Run with specific niceness
nice -n [10] [command]
Run with highest priority (root)
nice -n [-20] [command]
Run with lowest priority
nice -n [19] [command]
Show current niceness
nice
说明
nice runs a command with a modified CPU scheduling niceness. Higher niceness means the process is "nicer" and receives less CPU time (lower priority). Niceness ranges from -20 (highest priority) to 19 (lowest priority). With no command, nice prints the current niceness of the shell to standard output. When given a command with no -n, nice applies the default adjustment of +10.
参数
- -n, --adjustment=_N_
- Add integer _N_ to the niceness (default 10). Negative values raise priority.
- --help
- Display help information.
- --version
- Output version information.
FAQ
What is the nice command used for?
nice runs a command with a modified CPU scheduling niceness. Higher niceness means the process is "nicer" and receives less CPU time (lower priority). Niceness ranges from -20 (highest priority) to 19 (lowest priority). With no command, nice prints the current niceness of the shell to standard output. When given a command with no -n, nice applies the default adjustment of +10.
How do I run a basic nice example?
Run `nice [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n, --adjustment=_N_ do in nice?
Add integer _N_ to the niceness (default 10). Negative values raise priority.