问答

linux 如何查看进程的启动的路径源头

作者:admin 2021-04-30 我要评论

root@center1:~/douyin# ps aux|grep msg_test.pyroot 3133 0.0 0.1 116368 25284 pts/3 T 17:47 0:00 python3 msg_test.pyroot 3160 2.3 0.1 116820 25516 pts/...

在说正事之前,我要推荐一个福利:你还在原价购买阿里云、腾讯云、华为云服务器吗?那太亏啦!来这里,新购、升级、续费都打折,能够为您省60%的钱呢!2核4G企业级云服务器低至69元/年,点击进去看看吧>>>)
root@center1:~/douyin# ps aux|grep msg_test.py
root      3133  0.0  0.1 116368 25284 pts/3    T    17:47   0:00 python3 msg_test.py
root      3160  2.3  0.1 116820 25516 pts/3    S    17:48   0:13 python3 -u msg_test.py
root      3217  0.1  0.1 116368 25296 pts/3    T    17:49   0:00 python3 msg_test.py
root      3250  2.2  0.1 116756 25488 pts/3    S    17:50   0:10 python3 -u msg_test.py
root      3335  2.3  0.1 116600 25424 pts/3    S    17:51   0:10 python3 -u msg_test.py
root      3377  2.4  0.1 116636 25448 pts/3    S    17:51   0:09 python3 -u msg_test.py
root      3434  2.4  0.1 116624 25372 pts/3    S    17:51   0:09 python3 -u msg_test.py
root      4300  1.6  0.1 116236 25196 pts/3    T    17:57   0:00 python3 msg_test.py

linux 下面很多msg_testy.py进程 我如何知道那个进程是那个路径里面的msg_test.py 呢

###

查看进程的当前目录(cwd),如果基本没切换过就知道脚本的目录了:

$ readlink -f /proc/13993/cwd
/home/orz/snippets/code

如果切换过,也许可以通过调试器获取到文件路径。

如果还在不断启动新的进程,可以 execsnoop 跟踪。

版权声明:本文转载自网络,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本站转载出于传播更多优秀技术知识之目的,如有侵权请联系QQ/微信:153890879删除

相关文章
  • linux 如何查看进程的启动的路径源头

    linux 如何查看进程的启动的路径源头

  • Linux USER NAMESPACE chown Invalid a

    Linux USER NAMESPACE chown Invalid a

  • python3中mysql 插入多个字段如何处理

    python3中mysql 插入多个字段如何处理

  • pm2的exec_mode:cluster和-i max是同一

    pm2的exec_mode:cluster和-i max是同一

腾讯云代理商
海外云服务器