Link to home
Start Free TrialLog in
Avatar of Los Angeles1
Los Angeles1

asked on

Threads in a process

I can see processes with the following command

ps -ef | grep sshd

Open in new window


How do I see the threads that are running within a process ?
Avatar of wesly_chen
wesly_chen
Flag of United States of America image

ps -eLf
  to see the thread info for all the processes
the do

ps -eLf |grep <PID>
or
ps -eLF | grep   java
Another option is
ps axms
Avatar of Los Angeles1
Los Angeles1

ASKER

I had looked up the same command but could not get it to work

I cut and pasted from your note and got the following:

# ps -eLf
ps: 0509-048 Flag -p was used with invalid list.
Usage: ps [-AMNZaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
                [-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist] [-c classlist] [ -T pid] [ -L pidlist ]
                [-@ [wparname] ]
Usage: ps [aceglnsuvwxX] [t tty] [processnumber]
#
#
# ps axms
Usage: ps [-AMNZaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
                [-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist] [-c classlist] [ -T pid] [ -L pidlist ]
                [-@ [wparname] ]
Usage: ps [aceglnsuvwxX] [t tty] [processnumber]

Open in new window


I can do the following:

# ps -ef | grep sshd
    root 2031644 1442108   0   Sep 08      -  0:00 /usr/sbin/sshd
    root 2687200 2031644   0 14:29:31      -  0:00 sshd: root@pts/0
    root 4063300 2031644   0   Sep 20      -  0:00 sshd: root@pts/2
    root 2359608 2818144   0 17:16:23  pts/0  0:00 grep sshd
    root 3277552 2031644   0 17:15:02      -  0:00 sshd: root@pts/1
#

Open in new window


Something seems to be not quite right

I am using AIX 6.1
Avatar of woolmilkporc
To see the threads for a a particular process id PID under AIX:

ps -lm -p PID

wmp
AIX?
try
ps   am

Also do
man  ps
  and search "thread" for more information.
Is there a way to do that by specifying the process name instead of the PID ?
ps  am |grep  sshd
or
ps  -elm | grep sshd
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial