Go process inspector exposes process data on Linux and macOS with a common API.
Inspired by sys-proctable.
cmd := exec.Command("sleep", "5")
cmd.Start()
if process := proc.GetProcess(cmd.Process.Pid); process != nil {
process.Pid # <pid>
process.Command # "sleep"
process.ComandLine # []string{"sleep", "5"}
}
for _, p := range proc.GetAllProcesses() {
p.Pid
p.Command
p.CommandLine
}
Modern flavours of darwin and linux.
Apache 2.0