zoukankan      html  css  js  c++  java
  • Ubuntu -- 查看和杀死进程

     

    今天在netbeans中关闭webrick时,发现没有关闭掉,打入localhost:3000 依然显示页面,发现无法从nb中再次关闭

    只有进入ubuntu的进程下关闭

    查看进程:

    1,  ps -e  


    2,  feng@feng:~$ 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的进程:


    feng@feng:~$ sudo kill 7082

    二法:

    譬如Firefox现在僵死,无法相应请求。打开一个终端,输入:

    pgrep firefox

    会返回数值,譬如是7198.现在输入:

    kill 7198

    就会杀死Firefox进程了。

    你也可以使用killall命令。killall可以使用程序的名称,譬如输入:

    killall firefox

     

    3法

    如果前两者还是杀不死,用 kill -9 pid 命令,来绝杀

     

  • 相关阅读:
    C/C++&java communicate with each other 之 video file-streaming
    C/C++&java communicate with each other 之 video snapshot
    protobuf io 代码阅读
    利用逆波兰表达式,二叉树对sql语句解析
    cocos2d-x 添加sqlite3 时 报 lua_Number 错误
    error LNK2019: 无法解析的外部符号 _acosh,该符号在函数 _acoshFunc 中被引用
    visual studio 运行程序在副显示器上
    lua table 中#,getn,maxn 的区别
    'Cordova/CDVViewController.h' file not found
    [ISSUE]cannot run on the selected destination
  • 原文地址:https://www.cnblogs.com/mafeng/p/6796944.html
Copyright © 2011-2022 走看看