Priority
1)the priority rules.
-20 highest right, 19 lowest right, 0 default right.
2)the init priority
1@@@@check the priority.
[root@station13 Desktop]# ps axo command,nice,cpu,pid | grep init
/sbin/init 0 - 1
grep init 0 - 3065
@@@the init is origin of the user space,it begin after computer load the kernel.
2@@@backstage guard.
[root@station13 Desktop]# nohup sleep 777 &
[1] 3071
[root@station13 Desktop]# nohup: ignoring input and appending output to `nohup.out'
[root@station13 Desktop]# ps axo command,nice,pid | grep 'sleep 777'
sleep 777 0 3071
grep sleep 777 0 3090
@@@the command nohup is the backstage guard. even though you close the terminal
,it still run at backgroud.
3)reset the priority of process.
1@@@@change the 0 to -20(highest).
[root@station13 Desktop]# renice -20 3071
307
1: old priority 0, new priority -20
@@@the renice command trail the pid .
@@@only if you can find the pid of process,you could be change the priority.
@@@but remember only root could change the priority to highest.
2@@@@other users no permition to change the priority.
[root@station13 Desktop]# renice -19 3071
3071: old priority -20, new priority -19
[root@station13 Desktop]# su - student
[student@station13 ~]$ ps axo command,nice,pid | grep 'sleep 777'
sleep 777 -19 3071
grep sleep 777 0 3157
[student@station13 ~]$ renice 0 3071
renice: 3071: setpriority: Operation not permitted
[root@station13 Desktop]# renice -10 3071
3071: old priority -19, new priority -10
[root@station13 Desktop]# su - student
[student@station13 ~]$ renice -19 3071
renice: 3071: setpriority: Operation not permitted
[root@station13 Desktop]# ps axo command,pid,nice | grep 'sleep 99999'
sleep 99999 3341 0
grep sleep 99999 3366 0
[root@station13 Desktop]# su - student
[student@station13 ~]$ renice 19 3341
renice: 3341: setpriority: Operation not permitted
4)ps advancing apply.
1@@@@
[root@station13 Desktop]# service httpd start
[ OK ]
[root@station13 Desktop]# ps aux | grep httpd | head -n 2 | grep -v 'grep' | awk '{print $2}'| tr '\n' ' '
3233 3236
@@@it is used to compile
2@@@@
[root@station13 Desktop]# for i in `ps aux | grep nfs | awk'{print $2}'`;do
renice -20 $i; done
@@@advanced all the process priority of nfs.
3@@@@
[root@station13 Desktop]# nice -n -20 sleep 555
@@@begin with advancing the priority of the process.
5)kill the process
1@@@@
[root@station13 Desktop]# ps axo command,pid | grep 'sleep 99999'
sleep 99999 3341
grep sleep 99999 3362
[root@station13 Desktop]# kill -9 3341
[root@station13 Desktop]# ps axo command,pid,nice | grep 'sleep 99999'
grep sleep 99999 3411 0
@@@it force to kill the process by the pid.
6)tips: redhat6 lock screen.
1@@@@
#yum install Kdesktop_lock --force lock
@@@the root couldn't lock the screen at the redhat6.
7)tips: sort output
1@@@@
[root@station13 Desktop]# ps aux | sort -k 4 -n -r | head -n 5
root 1987 0.9 1.0 33152 21248 tty1 Ss+ 21:09 1:05 /usr/bin/Xorg :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-LIKqWa/database -nolisten tcp vt1
root 2615 0.1 0.9 50040 19268 ? S 21:26 0:06 python /usr/share/ibus/ui/gtk/main.py
root 2263 0.1 0.9 91848 20300 ? S 21:26 0:10 nautilus
root 2619 0.0 0.8 69680 17328 ? S 21:26 0:00 /usr/bin/gnote --panel-applet --oaf-activate-iid=OAFIID:GnoteApplet_Factory --oaf-ior-fd=22
root 3050 0.8 0.7 54696 15288 pts/0 S+ 22:01 0:27 gedit priority
8)iso
#mount -o loop issue.iso /mnt
#vim /etc/fstab
/issue.iso /mnt iso9660 defaults,loop 0 0
本文出自 “Oracle+Linux=>Majesty” 博客,谢绝转载!