Linux下使用命令结束进程

有时候某个软件卡死,想直接Kill掉。

1.ps -ef  或者 ps -aux 查看当前所有的进程:


2. kill -s 9 process_id   (-s means signal ) 

3. ps -ef或者ps -aux 两者列出来的进程都比较多,我们可以过滤。然后找到pid直接kill掉该进程。


4. pgrep firefox       pgrep 是专门用于进程查询的

 

如果这里能直接查出pid则,我们后面使用管道符号,直接干掉该进程

     1)pgrep firefox | xargs kill -s 9 

      或者

    2)kill -s 9 'grep firefox'

    或者

      3)pkill -9 firefox


5. 使用  pidof   查询

 


6.ps -ef|grep firefox|grep -v grep|cut -c 9-15|xargs kill -s 9 

xxxx:project/ $ ps -ef|grep firefox|grep -v grep|cut -c 9-15|xargs kill -s 9     

 

 

各种信号的含义:常见的有signal 11 / 9 / 6 / 3  android里面crash特别是系统级别的会常见。

 

 
  1. Signal Description Signal number on Linux x86[1]

  2. SIGABRT Process aborted 6

  3. SIGALRM Signal raised by alarm 14

  4. SIGBUS Bus error: "access to undefined portion of memory object" 7

  5. SIGCHLD Child process terminated, stopped (or continued*) 17

  6. SIGCONT Continue if stopped 18

  7. SIGFPE Floating point exception: "erroneous arithmetic operation" 8

  8. SIGHUP Hangup 1

  9. SIGILL Illegal instruction 4

  10. SIGINT Interrupt 2

  11. SIGKILL Kill (terminate immediately) 9

  12. SIGPIPE Write to pipe with no one reading 13

  13. SIGQUIT Quit and dump core 3

  14. SIGSEGV Segmentation violation 11

  15. SIGSTOP Stop executing temporarily 19

  16. SIGTERM Termination (request to terminate) 15

  17. SIGTSTP Terminal stop signal 20

  18. SIGTTIN Background process attempting to read from tty ("in") 21

  19. SIGTTOU Background process attempting to write to tty ("out") 22

  20. SIGUSR1 User-defined 1 10

  21. SIGUSR2 User-defined 2 12

  22. SIGPOLL Pollable event 29

  23. SIGPROF Profiling timer expired 27

  24. SIGSYS Bad syscall 31

  25. SIGTRAP Trace/breakpoint trap 5

  26. SIGURG Urgent data available on socket 23

  27. SIGVTALRM Signal raised by timer counting virtual time: "virtual timer expired" 26

  28. SIGXCPU CPU time limit exceeded 24

  29. SIGXFSZ File size limit exceeded 25

 

 

BLOG REFERENCE:  

blog.csdn.net/andy572633/article/details/7211546

 

Linux config samba:

http://my.oschina.net/junn/blog/171388

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值