Finding and Changing Current Working Directory

In the following tutorial, I will teach you how to find and change the working directory.

Working directory is the place in which irb is monitoring to load files and do other actions.

In order to know your current working directory, use Dir.pwd command to find out. pwd is short form for "print working directory"



Changing the working directory will be really helpful might be helpful in several different ways. If you need to change the current working directory, you need to use Dir.chdir(path_to_change) command. I want to change mine to "C:\". I typed in Dir.chdir("C:\\") and pressed enter. This changed my current working directory to "C:\"