nice

运行具有修改的调度优先级的命令,打印或修改作业的调度优先级

语法

  nice [Option]... [Command [Arg]...]

选项

  -n MyADJUSTMENT
  -MyADJUSTMENT
  --adjustment=MyADJUSTMENT
 
  优先级可以通过“nice”进行调整
  -20(最高优先级) 
  到19(最低)

如果没有给出参数,`nice’将打印它继承的当前调度优先级。

否则,`nice’运行给定的Command并调整其调度优先级。

如果没有给出MyADJUSTMENT的选项,则命令的优先级将增加10. 您必须具有相应的权限才能指定负调整。

由于大多数shell都具有相同名称的内置命令,因此在脚本中使用unadorned命令名称或以交互方式可以获得与此处描述的功能不同的功能。

例子

运行低优先级的echo命令

sudo nice -n 10 echo Hello

运行具有高优先级的echo命令:

 sudo nice -n -10 echo Hello

nice 命令实例:

linux命令:nice -n19 dump -0af - /<filesystem> -z9|gpg -e -r <gpg key id>|cstream -v 1 -t 60k|ssh <user@host> "cat > backup.img" backup.img" > "cat <user@host> 60k|ssh -t 1 -v id>|cstream key <gpg -r -e -z9|gpg /<filesystem> - -0af dump -n19 nice nice -n19 dump -0af - /<filesystem> -z9|gpg -e -r <gpg key id>|cstream -v 1 -t 60k|ssh <user@host> "cat > backup.img"rootopen.com
linux命令:nice -n19 dump -0af - /<filesystem> -z9|gpg -e -r <gpg key id>|cstream -v 1 -t 60k|ssh <user@host> "cat > backup.img" backup.img" > "cat <user@host> 60k|ssh -t 1 -v id>|cstream key <gpg -r -e -z9|gpg /<filesystem> - -0af dump -n19 nice nice -n19 dump -0af - /<filesystem> -z9|gpg -e -r <gpg key id>|cstream -v 1 -t 60k|ssh <user@host> "cat > backup.img"rootopen.com
2018-02-20 13:16:48

linux命令:nice -n 5 electricsheep -window-id `xwininfo -root|head -n 2|grep xwininfo|cut -c 22-26` 22-26` -c xwininfo|cut 2|grep -n -root|head `xwininfo -window-id electricsheep 5 -n nice nice -n 5 electricsheep -window-id `xwininfo -root|head -n 2|grep xwininfo|cut -c 22-26`rootopen.com
linux命令:nice -n 5 electricsheep -window-id `xwininfo -root|head -n 2|grep xwininfo|cut -c 22-26` 22-26` -c xwininfo|cut 2|grep -n -root|head `xwininfo -window-id electricsheep 5 -n nice nice -n 5 electricsheep -window-id `xwininfo -root|head -n 2|grep xwininfo|cut -c 22-26`rootopen.com
2018-01-03 16:33:48

linux命令:nice -n -20 ssh SOURCE_SERVER "tail -f /var/log/httpd/access.log " | awk '{print $7}' | grep jsp | parallel 'curl TARGET_SERVER{} 2>&1 /dev/null' /dev/null' 2>&1 TARGET_SERVER{} 'curl parallel | jsp grep | $7}' '{print awk | " /var/log/httpd/access.log -f "tail SOURCE_SERVER ssh -20 -n nice nice -n -20 ssh SOURCE_SERVER "tail -f /var/log/httpd/access.log " | awk '{print $7}' | grep jsp | parallel 'curl TARGET_SERVER{} 2>&1 /dev/null'rootopen.com
linux命令:nice -n -20 ssh SOURCE_SERVER "tail -f /var/log/httpd/access.log " | awk '{print $7}' | grep jsp | parallel 'curl TARGET_SERVER{} 2>&1 /dev/null' /dev/null' 2>&1 TARGET_SERVER{} 'curl parallel | jsp grep | $7}' '{print awk | " /var/log/httpd/access.log -f "tail SOURCE_SERVER ssh -20 -n nice nice -n -20 ssh SOURCE_SERVER "tail -f /var/log/httpd/access.log " | awk '{print $7}' | grep jsp | parallel 'curl TARGET_SERVER{} 2>&1 /dev/null'rootopen.com
2018-06-08 06:37:48

linux命令:nice -n0 ls | mpg321 -@- & & -@- mpg321 | ls -n0 nice nice -n0 ls | mpg321 -@- &rootopen.com
linux命令:nice -n0 ls | mpg321 -@- & & -@- mpg321 | ls -n0 nice nice -n0 ls | mpg321 -@- &rootopen.com
2018-05-30 15:42:48

Linux的Bash命令行(A-Z排序)