How to get information about your own process
by Lennart on Sep.02, 2008, under *NIX
If you want to get Information of your own process on a GNU/Linux system you should take a look at the /proc/self/ pseudo-directory. This directory contains information of the process that is reading it. You could also find out the PID of the process and read files in the /proc/[PID]/ directory. However, the /proc/self/ directory always keeps information of the process that is reading it.
Take a look at the proc manual pages to get an explanation of the files. (man proc) The most interesting may be /proc/self/status. It is a human readable version of the most values from /proc/self/stat and /proc/self/statm.
The /proc/ directory should be well known by every GNU/Linux system programmer as it contains a lot of useful information about your system and your processes.

