コマンドpstree PID
は、 で指定されたプロセスのすべてのサブプロセス情報を表示できますPID
。ただし、 process のすべての親プロセス情報も知りたいのですがPID
、どうすれば取得できますか?
例:
初期化 |- 親プロセス | | `- current_process | | |- subprocess_1 | | `- subprocess_2 `- その他のプロセス
私が欲しいのは、私が実行したときpstree current_process_pid
、以下の出力を得たいということです:
初期化 `- 親プロセス `- current_process |- subprocess_1 `- subprocess_2
を実行するpstree subprocess_1_pid
と、次のように出力されます。
初期化 `- 親プロセス `- current_process `- subprocess_1