LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-30-2009, 07:29 AM   #1
Hi_This_is_Dev
Member
 
Registered: May 2009
Location: India
Distribution: On my PC I use RHEL, at office AIX, Solaris, HP-UX, RHEL.
Posts: 254

Rep: Reputation: 18
Process ID


On the first virtual console I have executed this command:

Code:
watch -d date
And then I am back here in terminal window:

Code:
[root@localhost ~]# ps -af
UID        PID  PPID  C STIME TTY          TIME CMD
root      5850  5821  0 17:37 tty1     00:00:01 watch -d date
root      6555  5799  0 17:56 pts/1    00:00:00 ps -af
[root@localhost ~]#
The underlines PPID 5821 is not in PID. Why?

Now let's have a look at this command:
Code:
[root@localhost ~]# ps -f
UID        PID  PPID  C STIME TTY          TIME CMD
root      5799  5796  0 17:36 pts/1    00:00:00 bash
root      6624  5799  0 17:58 pts/1    00:00:00 ps -f
[root@localhost ~]#
Here 5799 is in both PID and PPID.
 
Old 09-30-2009, 08:24 AM   #2
sibaz
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Rep: Reputation: 1
PPID is the Parent PID, so I've got a clean terminal running bash and I've run vi, then put it into the background, while I run some tests on the commandline.

If I look at all processes running with full columns, i get this:-
sbazley@mowgli:~$ ps -f
UID PID PPID C STIME TTY TIME CMD
sbazley 4118 4084 0 Sep28 pts/2 00:00:00 /bin/bash
sbazley 15849 4118 0 14:16 pts/2 00:00:00 vi
sbazley 16099 4118 0 14:21 pts/2 00:00:00 ps -f

so you can see vi and ps -f are both processes who's parent is 4118, which is bash. If I grep for 4084 I get this:-

sbazley@mowgli:~$ ps ax |grep 4084
4084 ? Rl 1:49 konsole -session 101b719b1bd112000125308850900000036980014_1253177575_354018

Which shows bash was started by konsole, which is the KDE terminal program I'm using.
 
  


Reply

Tags
id, process



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
Shell script for reading a particular process contineously from process table vinaykori Linux - General 2 05-29-2009 06:52 AM
Finding the Process ID of a Process While Initiating the Process senthilmuthiah Linux - Newbie 7 04-02-2009 10:37 AM
child process usses same amount of ram as parent process socialjazz Programming 7 10-19-2006 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:19 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
Open Source Consulting | Domain Registration