Question
review
The commands kill `pidof gksu` , kill $ (pidof gksu) and killall gksu
YES Are equivalent
We take pidof appears to see the difference between these 3 commands:
'pidof' , 'pgrep' and 'options ps | grep'
Examples
alexa @ snowy -ux: ~ $ pgrep ssh
2571
2593 14326 29935
alexa @ snowy-ux: ~ $ ps AXU | grep ssh root
& amp; nbsp; 2571 0.0 0.0 46568 444? Ss Jun29 0 : 00 / usr / sbin / sshd
alexa 2593 0.0 0.0 40264 2820 pts / 1 S + 2:31 p.m. 0:00 ssh algarcia@192.168.2.4
alexa 4467 0.0 0.0 7276 840 pts / 2 S + ; 3:40 p.m. 0:00 grep ssh
& alexanbsp; 14 326 33 636 0.0 0.0 164? Ss Jul12 0:00 / usr / bin / ssh-agent x-session-manager
alexa 40 432 29 935 0.0 0.0 2960 pts / 3 S + 11:32 0:00 ssh alexa
algarcia@192.168.2.119 snowy-ux @ ~ $
alexa @ snowy-ux: ~ $ pidof ssh
29 935 2593
pidof - with the id of a process running , so are just these 2, the 2 running the ssh
pgrep instead (as pkill) - find or send signals to processes that contain these names or attributes. For that appear more, all
and
ps | grep - bring everyone to the same grep, which is a pid fijense more than
pgrep man pgrep From:
DESCRIPTION ; pgrep looks Through the Currently Running Processes and lists the process IDs Which matches the selection criteria to stdout. Have All the criteria to match. For example,
;; $ pgrep -u root sshd
will only list the processes called sshd AND owned by root. On the other hand,
$ pgrep -u root,daemon
will list the processes owned by root OR daemon.
pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.
Más ejemplos:
Sacados de la pag man
alexa@ snowy-ux: ~ $ ps axu | grep nautilus
alexa 7089 0.0 0.0 5216 764 pts / 3 D + 24:36 0:00 grep nautilus
alexa 25795 0.0 0.0 21476 416? S Sep08 0:00 / usr / lib / nautilus-cd-burner / mapping-daemon
alexa 30 481 0.0 1.0 501 260 41 936's ; Nov16 0:30 nautilus - sm-client-id 110a01e879000127894049400000142840001 - screen 0
alexa @ snowy-ux: ~ $ pidof nautilus
30,481 alexa @ snowy-ux: ~ $ pgrep-u alexa nautilus
30,481
Mandandole Senales
snowy: axu ~ # ps | grep syslog root
2529 0.0 0.0 5936 420? Ss Jun29 0:05 / sbin / syslogd root 7343 0.0 0.0 7276
844 pts / 3 , & nbsp, S + 12:44 0:00 grep syslog
snowy
: ~ # pkill-HUP syslogd
snowy
: AXU ~ # ps | grep syslog root
, 2529 0.0 0.0 5936 420? Ss Jun29 0:05 / sbin / syslogd root
, 7352 0.0 0.0 7276 848 pts / 3 S + 12:44 0:00 grep syslog
So
rereads its configuration, with the signHUP l
in this case, you must be root to
Remember kill-l lists the signal we
alexa @ snowy-ux: ~ $ kill-l
1) SIGHUP 2) SIGINT 3) SIGQUIT , 4)
SIGILL 5) SIGTRAP 6) SIGABRT , & nbsp; 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12), SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGSTKFLT
17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU
25) SIGXFSZ 26) SIGVTALRM, 27) SIGPROF 28) SIGWINCH
29) SIGIO , 30) SIGPWR 31) SigSys 34) SIGRTMIN
35) SIGRTMIN +1 36) SIGRTMIN +2 37) SIGRTMIN +3 38) SIGRTMIN +4
39) SIGRTMIN +5 , 40) SIGRTMIN +6 41) SIGRTMIN +7 & nbsp; 42) SIGRTMIN +8
43) SIGRTMIN +9 44) SIGRTMIN +10 45) SIGRTMIN +11 46) SIGRTMIN
+12 47) SIGRTMIN +13 48) SIGRTMIN +14 49) SIGRTMIN +15 50) 14 SIGRTMAX-
51) SIGRTMAX- 13 52) 12 SIGRTMAX- 53) SIGRTMAX- 11 54) 10 SIGRTMAX-
55) SIGRTMAX- 9 56) 8 57 SIGRTMAX-) SIGRTMAX- 7 ; 58) SIGRTMAX- 6
59) SIGRTMAX- 5 60) 4 61 SIGRTMAX-) SIGRTMAX- 362) SIGRTMAX- 2
63) SIGRTMAX- 1 64) SIGRTMAX
To study
ps-fp $ (pgrep-d ,-x xterm)
kill -9 -1 : kill all you can kill procesos.
0 comments:
Post a Comment