ps
Shows process information.
The Process Status (ps) is used to monitor:
- A process.
- Whether the process is still consuming CPU cycles.
- Which threads of a process are still running.
To start ps monitoring a process, type:
ps -fp <PID>
Your
output should be: UID PID PPID C STIME TTY TIME CMD
user12 29730 27936 0 21 Jun - 12:26 java StartCruise
Where - UID
- The userid of the process owner. The login name is printed under the -f flag.
- PPID
- The Parent Process ID.
- PID
- The Process ID.
- C
- CPU utilization, incremented each time the system clock ticks and the process is found to be running. The value is decayed by the scheduler by dividing it by 2 every second. For the sched_other policy, CPU utilization is used in determining process scheduling priority. Large values indicate a CPU intensive process and result in lower process priority whereas small values indicate an I/O intensive process and result in a more favorable priority.
- STIME
- The start time of the process, given in hours, minutes, and seconds. The start time of a process begun more than twenty-four hours before the ps inquiry is executed is given in months and days.
- TTY
- The controlling workstation for the process.
- TIME
- The total execution time for the process.
- CMD
- The full command name and its parameters.
ps -mp <PID> -o THREAD
Your
output should be: USER PID PPID TID ST CP PRI SC WCHAN F TT BND COMMAND
user12 29730 27936 - A 4 60 8 * 200001 pts/10 0 java StartCruise
- - - 31823 S 0 60 1 e6007cbc 8400400 - 0 -
- - - 44183 S 0 60 1 e600acbc 8400400 - 0 -
- - - 83405 S 2 60 1 50c72558 400400 - 0 -
- - - 114071 S 0 60 1 e601bdbc 8400400 - 0 -
- - - 116243 S 2 61 1 e601c6bc 8400400 - 0 -
- - - 133137 S 0 60 1 e60208bc 8400400 - 0 -
- - - 138275 S 0 60 1 e6021cbc 8400400 - 0 -
- - - 140587 S 0 60 1 e60225bc 8400400 - 0 -
Where - USER
- The user name of the person running the process.
- TID
- The Kernel Thread ID of each thread.
- ST
- The state
of the thread:
- O
- Nonexistent.
- R
- Running.
- S
- Sleeping.
- W
- Swapped.
- Z
- Canceled.
- T
- Stopped.
- CP
- CPU utilization of the thread.
- PRI
- Priority of the thread.
- SC
- Suspend count.
- ARCHON
- Wait channel.
- F
- Flags.
- TAT
- Controlling terminal.
- BAND
- CPU to which thread is bound.
For more details, see the manual page for ps.