Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

dir
pwd
ruby
communitycreator

What is Dir.pwd in Ruby?

okwudili onyejiaku

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

The Dir class’s pwd is a property that returns the path to the current process’s current working directory as a string.

Syntax

Dir.pwd

Return value

The value returned is a string representation of the current working directory.

Code example

puts Dir.pwd

Code explanation

  • Line 1: We print the name of the current working directory using the Dir class pwd property.

RELATED TAGS

dir
pwd
ruby
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring