c - Process name from its pid in linux -
How to get the process name from his PID? For example, I execute cat file1.txt, but I have to find out that since the cat command and its logic system in its pid. Is there a straight to determine or something similar? Any ideas?
There is no common way to do this unix. Each OS has a different way to handle it, There are different ways and some are very difficult. Although you mention Linux, the information is in the proc / proc filesystem. To get the command line for the process id 99 99, read the file / proc / 9999 / cmdline .
Comments
Post a Comment