I am going to make program to get process informaition(pid, process name, virtual memory, physical memory ) using procfs. and i want print like this
PID Name Virtual physical shared
1 init 1234 123 22
33 firefox 33 33 2
I think I can get the process information through proc/[pid]/stat I think I should know the pid if i want to get process information. but the problem is how can can I get the pid only given the process name.
because process pid is changed after reboot or after terminated and restart.
so my question is Is there a way to get the pid if I only know process name? not using shell script
is there file in proc folder that contains all of processse running now? suppose that I only know process name( ex) firefox), I want to get pid using proc and proc filesystem