Ubuntu 查看和殺死進程[轉]

來源:互聯網
上載者:User

標籤:io   os   使用   sp   java   for   on   cti   bs   

今天在netbeans中關閉webrick時,發現沒有關閉掉,打入localhost:3000 依然顯示頁面,發現無法從nb中再次關閉
只有進入ubuntu的進程下關閉
查看進程:
1法,ps -e 命令 

 

[email protected]:~$ sudo netstat -antup
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      4672/cupsd      
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      7082/ruby       
tcp        0      0 192.168.1.102:41121     66.113.164.119:80       ESTABLISHED 5709/firefox    
tcp        0      0 192.168.1.102:44746     209.85.201.125:5222     ESTABLISHED 6130/pidgin     
tcp        0      0 192.168.1.102:54797     192.168.1.128:3306      ESTABLISHED 7082/ruby       
tcp        0      0 192.168.1.102:43466     64.4.34.77:1863         ESTABLISHED 6130/pidgin     
tcp        0      0 192.168.1.102:41999     64.233.189.19:443       ESTABLISHED 5709/firefox    
tcp        0      0 192.168.1.102:54900     58.251.60.53:80         ESTABLISHED 6130/pidgin     
tcp        0      0 192.168.1.102:34180     220.181.37.210:80       TIME_WAIT   -               
tcp6       0      0 ::1:42801               :::*                    LISTEN      6863/java       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           5161/dhclient   
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           4625/avahi-daemon: 
udp        0      0 0.0.0.0:56699           0.0.0.0:*                           4625/avahi-daemon: 

 

殺死webrick的進程:
[email protected]:~$ sudo kill 7082

 

2法:
譬如Firefox現在僵死,無法相應請求。開啟一個終端,輸入:

 

pgrep firefox

會返回數值,譬如是7198.現在輸入:

kill 7198

就會殺死Firefox進程了。

你也可以使用killall命令。killall可以使用程式的名稱,譬如輸入:

killall firefox

 

 

3法

如果前兩者還是殺不死,用 kill -9 pid 命令,來絕殺

Ubuntu 查看和殺死進程[轉]

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.