LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-12-2009, 02:12 PM   #1
sugantha
Member
 
Registered: Feb 2008
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43

Rep: Reputation: 15
ps command displaying different result each time


Hello all...When I execute ps in my machine, this is the result I get, which is totally confusing.

[sugantha@localhost ~]$ ps aux | grep netbeans
sugantha 7952 0.0 0.0 83708 760 pts/2 S+ 05:08 0:00 grep netbeans

[sugantha@localhost ~]$ kill -9 7952
bash: kill: (7952) - No such process

[sugantha@localhost ~]$ ps aux | grep netbeans
sugantha 7954 0.0 0.0 316 112 pts/2 R+ 05:08 0:00 grep netbeans

From the first result I get that netbeans has a pid of 7952. Yet when I try to kill the process it says no such process. Then I see netbeans running in a different process ID. What does this mean... Any help is appreciated. My distro is Fedora 9. Thank you in advance.
 
Old 09-12-2009, 02:44 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

netbeans isn't running in the first place :-)

ps aux | grep netbeans
sugantha 7952 0.0 0.0 83708 760 pts/2 S+ 05:08 0:00 grep netbeans


This shows the grep process itself, not the netbeans process (grep did not find it).

To exclude grep from its own search (one way of doing it): ps aux | grep netbeans | grep -v grep

Hope this helps.
 
Old 09-12-2009, 02:47 PM   #3
sugantha
Member
 
Registered: Feb 2008
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks for the response. It makes sense now..
 
  


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
How to pass the result of a command to another command (like grep) desb01 Programming 4 06-25-2009 01:09 PM
command result as varible mkiler Programming 1 03-10-2009 11:22 AM
python - getting command result Hewson Programming 1 08-01-2007 07:22 PM
displaying the time in enlightenment wm sether Linux - Software 6 09-25-2004 03:26 AM
BASH Command Result redhatnoob Programming 2 08-19-2004 07:25 PM


All times are GMT -5. The time now is 02:50 PM.

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