查看进程路径的方法取决于你使用的操作系统。以下是 Windows 和 Linux 下常用且实用的方法:
Ctrl + Shift + Esc)如果右键没有该选项,可用下面方法。
wmicwmic process where "name='进程名.exe'" get executablePath
示例:
wmic process where "name='chrome.exe'" get executablePath
Get-Process 进程名 | Select-Object Name, Path
示例:
Get-Process chrome | Select-Object Name, Path
查看所有进程路径:
Get-Process | Where-Object {$_.Path -ne $null} | Select-Object Name, Path
/proc 目录(最准确)ls -l /proc/PID/exe
示例:
ls -l /proc/1234/exe
输出示例:
lrwxrwxrwx 1 user user 0 ... /proc/1234/exe -> /usr/bin/nginx
ps 命令ps -p PID -o exe=
或查看完整命令:
ps -fp PID
lsoflsof -p PID | grep txt
ps -p PID -o comm=
或:
ls -l /proc/PID/exe # macOS 部分版本不支持 /proc
cat /proc/PID/cmdline
如果你愿意,可以告诉我:
我可以给你 精确到命令级别 的操作步骤。