Jim Yin
Jim Yin

Reputation: 121

how to locate the shell script file of a process

Suppose I saw a process X in output of top or ps, I want to know which shell script started it, is there a easy way? I think it's too stupid to find/grep the whole harddisk.

EDIT: I just want to find the script file name and path, not the command line which start the process.

Upvotes: 0

Views: 88

Answers (1)

kjelderg
kjelderg

Reputation: 392

In ps, there is the ability to view ppid, the parent process id. That will indicate the process that started the child. For a prettier display, check out pstree.

Upvotes: 1

Related Questions