I want to know how to find out my PID processing ID. However when I try to do this it says:
cat: /proc/PID/status: No such file or directory
The command I tried is:
cat /proc/PID/status
|
I want to know how to find out my PID processing ID. However when I try to do this it says:
The command I tried is:
| ||||
|
feedback
|
|
In If you want to find out a process ID, just use
The PID will be the second column, the third column is the parent process ID. | |||
|
feedback
|
|
In most shells and in Perl, your current pid is in the variable
| |||
|
feedback
|
|
The easiest way is to use the top command on a terminal for output like this: top - 11:09:20 up 9 min, 2 users, load average: 0.14, 0.39, 0.39 Tasks: 178 total, 2 running, 176 sleeping, 0 stopped, 0 zombie Cpu(s): 2.3%us, 1.0%sy, 0.0%ni, 96.5%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st Mem: 3081644k total, 1178648k used, 1902996k free, 128244k buffers Swap: 0k total, 0k used, 0k free, 392340k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND The first column of the output with the four digit numbers (in this particular output) is the process ID for the process name at the far right of the table. BTW, press 'q' to exit top or it will keep polling and updating endlessly every few seconds. top only shows a screenful's worth of lines with the hungriest processes rather than the dozens of total processes. You can use slhck's pattern to find other processes. Even my own example had about 200 processes running. You probably are looking for your process ID as an intermediate step to something else. If you need to kill a process, because it's out of control, you can research kill and killall. you can type man kill and it will give you useful info. To exit that *man*page and most other interactive CLI programs such as top, press 'q'. | |||
|
feedback
|