# Process id

**URL:** <https://www.ruby-forum.com/t/process-id/182973>\
**Category:** Ruby\
**Created:** [February 5, 2010, 12:53pm UTC](https://www.ruby-forum.com/t/process-id/182973 "2010-02-05T12:53:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8797f3/32.png) [@rosy](https://www.ruby-forum.com/u/rosy)\
**Post date:** [February 5, 2010, 12:53pm UTC](https://www.ruby-forum.com/t/process-id/182973/1 "2010-02-05T12:53:18Z")

</div>

All,

I have to get the process id for a specified ruby program.  
(e.x) $0 returns the current process name Process.pid returns the  
current  
process id.So how can i get the specified program’s pid.

---

<div class="post-metadata">

**Author:** ![rosy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8797f3/32.png) [@rosy](https://www.ruby-forum.com/u/rosy)\
**Post date:** [February 5, 2010, 5:27pm UTC](https://www.ruby-forum.com/t/process-id/182973/2 "2010-02-05T17:27:09Z")

</div>

> I have to get the process id for a specified ruby program.  
> (e.x) $0 returns the current process name Process.pid returns the  
> current  
> process id.So how can i get the specified program’s pid.

So you want something like “lookup some other ruby program’s PID”?  
-r

---

<div class="post-metadata">

**Author:** ![rosy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8797f3/32.png) [@rosy](https://www.ruby-forum.com/u/rosy)\
**Post date:** [February 5, 2010, 5:35pm UTC](https://www.ruby-forum.com/t/process-id/182973/3 "2010-02-05T17:35:09Z")

</div>

On Feb 5, 9:28 am, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I have to get the process id for a specified ruby program.  
> > (e.x) $0 returns the current process name Process.pid returns the  
> > current  
> > process id.So how can i get the specified program’s pid.
> 
> So you want something like “lookup some other ruby program’s PID”?  
> -r

Presumably, in which case you want sys-proctable.

gem install sys-proctable

Regards,

Dan
