Kanrisuru

pwd

Get the current working directory in ruby
linux manual

Basic Usage

require 'kanrisuru'
host = Kanrisuru::Remote::Host.new(host: 'localhost', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])

result = host.pwd
result.success? 
true

result.path
"/home/ubuntu"

Parameters

None

Result

Returns a FilePath struct.

FilePath Fields

Field Type Description
path string File path of the current working directory

Return Example

host.pwd.data
#<Struct:Kanrisuru::Core::Path::FilePath:0x00000708
  path = "/home/ubuntu"
>

Exit Status

Code Description
0 Success
1 Failure

Tested On

  • Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES