find out what the current directory is with Dir.pwd : pwd « File Directory « Ruby






find out what the current directory is with Dir.pwd

puts Dir.pwd
Dir.chdir("/usr/bin")
puts Dir.pwd

 

Related examples in the same category

1.change directories (using an absolute path), and then store the value of the directory path in a variable.