I am using Ubuntu 12.04 . I would like to know how can I do operations on a process through its PID . I don’t know whether is it possible or not. If possible help me on this. Operations means status, properties of the process and sending commands and data to process through it PID .
EDIT: Status means its working statistics, for example how much RAM it’s consuming. Properties means information regrading that process. The main thing I want to know here is about sending commands/data to process through its PID.
procfs is something you should have a look at. It provides a lot of information on the process. Here is the manpage for proc(5).
Basically, you cd to
/proc/$PIDand all those pseudo files contain info you should be able to look at.Otherwise, a good program to play with is
top, or even better,htop. It can send all sorts of signals, and you can observe a lot of info (status, mem usage, cpu usage,…) It’s really great.Apart from that it’s not clear what you’re looking to do, so I’m staying pretty generic. If you want to do IPC (inter process communication) as sarnold said, signals might be the way to go, or mmap. (memory-mapped file)