Solved

Threads in a process

Posted on 2011-09-21
8
596 Views
Last Modified: 2013-11-17
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 ?
0
Comment
Question by:Los Angeles1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36576873
ps -eLf
  to see the thread info for all the processes
the do

ps -eLf |grep <PID>
or
ps -eLF | grep   java
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36576891
Another option is
ps axms
0
 

Author Comment

by:Los Angeles1
ID: 36577008
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
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36577034
To see the threads for a a particular process id PID under AIX:

ps -lm -p PID

wmp
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36577053
AIX?
try
ps   am

Also do
man  ps
  and search "thread" for more information.
0
 

Author Comment

by:Los Angeles1
ID: 36577055
Is there a way to do that by specifying the process name instead of the PID ?
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 36577076
ps  am |grep  sshd
or
ps  -elm | grep sshd
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 36577084
A process doesn't have a name.  There is a command and its arguments.

ps -e -o pid,comm | grep command | while read PID CMD
  do
   ps -lm -p $PID
  done

Replace  command with the "name" you're looking for.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question