Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我在 top 或 ps 的输出中看到了一个进程 X,我想知道它是由哪个 shell 脚本启动的,有没有简单的方法?我认为查找/grep整个硬盘太愚蠢了。
编辑:我只想找到脚本文件名和路径,而不是启动进程的命令行。
在ps中,可以查看ppid,父进程id。这将指示启动子进程的进程。要获得更漂亮的显示,请查看 pstree。