# How to find the current path?

**URL:** <https://www.ruby-forum.com/t/how-to-find-the-current-path/65475>\
**Category:** Ruby\
**Created:** [February 10, 2006, 6:49pm UTC](https://www.ruby-forum.com/t/how-to-find-the-current-path/65475 "2006-02-10T18:49:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaatschS\_Bernd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/fbc32d/32.png) [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Post date:** [February 10, 2006, 6:49pm UTC](https://www.ruby-forum.com/t/how-to-find-the-current-path/65475/1 "2006-02-10T18:49:06Z")

</div>

Hello,

I am fairly new to ruby and wonder if there is a class/method that  
returns  
the absolute path of the current directory (the directory I execute the  
ruby  
script from)?

Thanks,  
–Bernd

---

<div class="post-metadata">

**Author:** ![PaatschS\_Bernd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/fbc32d/32.png) [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Post date:** [February 10, 2006, 7:02pm UTC](https://www.ruby-forum.com/t/how-to-find-the-current-path/65475/2 "2006-02-10T19:02:57Z")

</div>

On Feb 10, 2006, at 11:48 AM, Paatsch, Bernd wrote:

> Hello,
> 
> I am fairly new to ruby and wonder if there is a class/method that  
> returns  
> the absolute path of the current directory (the directory I execute  
> the ruby  
> script from)?

I believe this is what you are after:

$ ruby -e ‘p Dir.pwd’  
“/Users/james”

Hope that helps.

James Edward G. II
