在linux中查看有那些进程,并杀死已经关闭的进程

#查看进程,启动进程和关闭进程的 命令如下

[root@localhost WN]# cd CALCULATION/
[root@localhost CALCULATION]# ps -ef|grep 'calculation_server.py'
root     11030 10932  0 10:22 pts/36   00:00:00 grep --color=auto calculation_se                                                                           rver.py
[root@localhost CALCULATION]# python calculation_server.py >log.txt
^Z
[1]+  已停止               python calculation_server.py > log.txt
[root@localhost CALCULATION]# ps -ef|grep 'calculation_server.py'
root     11102 10932 15 10:23 pts/36   00:00:09 python calculation_server.py
root     11247 10932  0 10:24 pts/36   00:00:00 grep --color=auto calculation_server.py
[root@localhost CALCULATION]# kill -9 11102
[root@localhost CALCULATION]# ps -ef|grep 'calculation_server.py'
root     11270 10932  0 10:24 pts/36   00:00:00 grep --color=auto calculation_server.py
[1]+  已杀死               python calculation_server.py > log.txt
[root@localhost CALCULATION]#

通过grep 进行筛选

通过kill -9 彻底杀死进程

通过>log.txt 可以将python的打印信息重定向

[root@localhost CALCULATION]# cat log.txt
in getConfigFileChangeTime_server CALCULATION
in restartManually_server CALCULATION
rpc_queue_calculation_power [x] Awaiting RPC requests
rpc_queue_calculation_rose [x] Awaiting RPC requests
rpc_queue_get_config_time_CALCULATION [x] Awaiting RPC requests
rpc_queue_manual_restart_CALCULATION [x] Awaiting RPC requests
in wind_power_callback, body: {"fanNo":["INS001","INS002"],"starttime":1609549835,"endtime":1612141835,"step":1000,"type":0}
requestInfo is: {'endTime': 1612141835, 'subSystemName': u'INS001', 'startTime': 1609549835}
查询粗粒度历史请求超时未返回数据,请检查粗粒度历史服务是否开启!
getData from liuZan windSpeedList, windPowerList is: [] []
requestInfo is: {'endTime': 1612141835, 'subSystemName': u'INS002', 'startTime': 1609549835}
查询粗粒度历史请求超时未返回数据,请检查粗粒度历史服务是否开启!
getData from liuZan windSpeedList, windPowerList is: [] []
in wind_power_callback, body: {"fanNo":["INS001"],"starttime":1612142871000,"endtime":1612146471000,"step":1000,"type":3}
13 True
-----year, Last
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值