Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • best-practice is to use ps command when possible instead of opening/reading/parsing files under /proc/pid/ because the files and contents of files under /proc/pid can change whenever the kernel version changes. for example: i had a script that worked on kernel version 3.x and then the same script failed on 5.x kernel version. i changed the script to use ps and now it works in both kernel version 3.x and 5.x. Commented Jan 9, 2024 at 15:29