Skip to main content
added 6 characters in body
Source Link

###Try ps -efj | lessTry

ps -efj | less

###SpecificallySpecifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

###OROR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

###Examples::

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

###SAMPLE:SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

####Assuming 1234 is PID and you want to know its associated PPID, PGID, SID & CMDAssuming 1234 is PID and you want to know its associated PPID, PGID, SID & CMD


####Tested on CentOS/RedHat 6.x & 7.xTested on CentOS/RedHat 6.x 7.x and 8.x

###Try ps -efj | less

###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

###OR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

###Examples:

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

###SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

####Assuming 1234 is PID and you want to know its associated PPID, PGID, SID & CMD


####Tested on CentOS/RedHat 6.x & 7.x

Try

ps -efj | less

Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

OR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

Examples:

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

Assuming 1234 is PID and you want to know its associated PPID, PGID, SID & CMD


Tested on CentOS/RedHat 6.x 7.x and 8.x

###Try ps -efj | less

###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

###OR for better-formatted output, try:###OR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

###Examples:

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

###SAMPLE###SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

####Assuming 1234 is PID and you want to know it's associated PPID, PGID, SID & CMD####Assuming 1234 is PID and you want to know its associated PPID, PGID, SID & CMD


####Tested on CentOS/RedHat 6.x & 7.x####Tested on CentOS/RedHat 6.x & 7.x

###Try ps -efj | less

###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

###OR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

###Examples:

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

###SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

####Assuming 1234 is PID and you want to know it's associated PPID, PGID, SID & CMD


####Tested on CentOS/RedHat 6.x & 7.x

###Try ps -efj | less

###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

###OR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

###Examples:

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

###SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

####Assuming 1234 is PID and you want to know its associated PPID, PGID, SID & CMD


####Tested on CentOS/RedHat 6.x & 7.x

Improved formatting.
Source Link

Try###Try ps -efj | less

###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | lessgrep ProcessName

ps -efj | grep PID

If you want to find out PID/PGID/PPID/SID to certain process or pid:###OR for better-formatted output, try:

ps -efjejf | grepegrep process'STIME|ProcessName'
    
ps -efjejf | grepegrep pid'STIME|pid'

OR for better formatted output, try###Examples:

ps -ejf | egrep 'STIME | process'
'STIME|http'

ps -ejf | egrep 'STIME | pid''STIME|1234'

Examples###SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME'STIME|http'

UID | vmware'      PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
psram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-ejfhttp |--spawner egrep:1.3 'STIME/org/gtk/gvfs/exec_spaw/1
apache | 1234' 11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

...assuming 1234 is pid and you want to know it's associated PPID, PGID, and SID and CMD. ####Assuming 1234 is PID and you want to know it's associated PPID, PGID, SID & CMD

 

Tested on CentOS/RHEL 6.5*####Tested on CentOS/RedHat 6.x & 7.x

Try

ps -efj | less

If you want to find out PID/PGID/PPID/SID to certain process or pid:

ps -efj | grep process

ps -efj | grep pid

OR for better formatted output, try:

ps -ejf | egrep 'STIME | process'


ps -ejf | egrep 'STIME | pid'

Examples:

ps -ejf | egrep 'STIME | vmware'

ps -ejf | egrep 'STIME | 1234'

...assuming 1234 is pid and you want to know it's associated PPID, PGID, and SID and CMD.

Tested on CentOS/RHEL 6.5*

###Try ps -efj | less

###Specifically, if you want to find out PID/PGID/PPID/SID for a certain ProcessName or PID, Try:

ps -efj | grep ProcessName

ps -efj | grep PID

###OR for better-formatted output, try:

ps -ejf | egrep 'STIME|ProcessName'
    
ps -ejf | egrep 'STIME|pid'

###Examples:

ps -ejf | egrep 'STIME|http'

ps -ejf | egrep 'STIME|1234'

###SAMPLE:

[ram@thinkred1cartoon ~]$ ps -ejf | egrep 'STIME|http'

UID        PID  PPID  PGID   SID  C STIME TTY          TIME CMD
root      1450     1  1450  1450  0 08:45 ?        00:00:04 /usr/sbin/httpd -DFOREGROUND
ram       3717     1  2589  2589  0 08:47 ?        00:00:00 /usr/libexec/gvfsd-http --spawner :1.3 /org/gtk/gvfs/exec_spaw/1
apache   11518  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11519  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11520  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11521  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache   11522  1450  1450  1450  0 09:40 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

####Assuming 1234 is PID and you want to know it's associated PPID, PGID, SID & CMD

 

####Tested on CentOS/RedHat 6.x & 7.x

added 51 characters in body
Source Link
Loading
I figured, ps -ejf | egrep 'PID | process or pid ' although workable, would confuse people.
Source Link
Loading
added 64 characters in body
Source Link
Loading
Source Link
Loading