linux shell 查看进程的可执行程序路径
2012-10-25 13:49
357 查看
注:此方法仅在bash下测试有效。
ps -el | grep hello
ls -l /proc/19120/exe | awk '{print $11}'
hello是某程序的名字,ps -el | grep hello 命令把是hello名字进程全部列出来。
然后,加入要查看进程号PID为19120的可执行程序路径,ls -l /proc/19120/exe | awk '{print $11}'
写一个脚本获取指定进程名字的绝对路径,该脚本匹配包含参数1的进程名,列出所有进程的可执行程序的路径。
脚本文件psd 如下
转自:http://hi.baidu.com/xncehkcfrpjrtue/item/8a0eae10d090b424f7625c73
ps -el | grep hello
ls -l /proc/19120/exe | awk '{print $11}'
hello是某程序的名字,ps -el | grep hello 命令把是hello名字进程全部列出来。
然后,加入要查看进程号PID为19120的可执行程序路径,ls -l /proc/19120/exe | awk '{print $11}'
写一个脚本获取指定进程名字的绝对路径,该脚本匹配包含参数1的进程名,列出所有进程的可执行程序的路径。
脚本文件psd 如下
#! /bin/bash if [ $# -ne 1 ] ; then echo "Usage: psd exe" exit 1 fi for pid in `ps -e | grep $1 | awk '{print $1}'` ; do echo -n "${pid} " ls -l /proc/${pid}/exe | awk '{print $11}' done
转自:http://hi.baidu.com/xncehkcfrpjrtue/item/8a0eae10d090b424f7625c73
相关文章推荐
- linux shell 查看进程的可执行程序路径
- Linux查看上可执行程序或运行进程的依赖库
- linux 程序内部 查看可执行程序路径
- linux 下查看一个进程执行路径
- linux 下查看某进程的完整执行路径
- linux shell 查看进程运行或绑定的cpu和绑定执行进程到特定cpu上执行的方法
- Linux下查看进程的执行文件绝对路径
- 查看文件内容- 删除某个运行程序的所有进程-nohup后台执行程序
- linux通过端口号(进程号pid)查找程序执行路径
- Linux查看可执行程序所在路径
- Linux查看可执行程序所在路径
- 在Linux程序中如何获得本进程的可执行文件的全路径?
- 看看端口被哪个程序占用了,如何查看任务进程对应的安装路径?
- 在Linux程序中如何获得本进程的可执行文件的全路径?
- linux中根据进程的PID值来查找执行文件的及其路径
- linux 查看进程启动路径
- WPF中获取程序执行路径ExecutablePath
- Linux操作系统分析(2)- 进程的创建与可执行程序的加载
- ldd查看可执行程序依赖的文件
- windows下查看进程对应的程序