LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2009, 12:38 AM   #1
haseit
LQ Newbie
 
Registered: Jan 2009
Location: Colombo / Sri Lanka
Posts: 14

Rep: Reputation: 0
How to get the PID for COMMAND


Hello All,

I 've question on How to get the PID if the CMD is give using "ps" and additional commands.

Eg:

UID PID PPID C STIME TTY TIME CMD
root 3724 1 0 10:06 ? 00:00:00 konqueror -mimetype inode/directory system:/
root 3847 3111 0 10:14 ? 00:00:00 eclipse
root 3848 3847 2 10:14 ? 00:01:17 /usr/bin/java -Xms40m -Xmx256m -Dosgi.sharedConfiguration.area=/usr/lib/eclipse/configuration -jar /usr/shar
root 3973 3111 0 10:25 ? 00:00:01 konsole
root 3974 3973 0 10:25 pts/3 00:00:00 /bin/bash


if i need to get the PID of eclipse in the given CMD colum, How do i get it using the "ps" command.

as in the above eg i only need to get the pid 3847 using the CMD colum
---

Please help me on this

Thank you in advance,
Hasantha
 
Old 03-09-2009, 12:45 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
manpage will help you to find more options
ps ax | grep eclipse
or
pgrep eclipse
 
Old 03-09-2009, 01:35 AM   #3
haseit
LQ Newbie
 
Registered: Jan 2009
Location: Colombo / Sri Lanka
Posts: 14

Original Poster
Rep: Reputation: 0
Hello kirukan,

Thank you for the support. it worked and i really appriciate for the post.

Regards,

Hasantha
 
Old 03-09-2009, 01:54 PM   #4
sureshsujatha
Member
 
Registered: Mar 2009
Posts: 40

Rep: Reputation: 15
@kirukan,
I found your inputs very useful for a particular test case scenario I encountered at work. Thanks for sharing your knowledge!

Last edited by sureshsujatha; 03-14-2009 at 12:15 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find PID of /bin/sh command in C++ Curtor Programming 3 12-11-2008 09:04 AM
pid in netstat command on solaris girish_hilage Linux - Networking 1 03-10-2007 01:52 AM
PID Kill Script or command ? Webmin rapture_1 Linux - General 1 11-02-2005 11:11 AM
PID display command for kernel modules jedblack Linux - Software 1 11-28-2003 06:01 PM
how to get PID without using pidof command? ruchika Programming 2 09-22-2003 03:12 PM


All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration