Kanrisuru

unlink

Remove a single file by unlinking it’s inode in ruby.
linux manual

Basic Usage

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

result = host.unlink('~/file1.txt')
result.success?
true

Parameters

Field Type Description
path string
Required name of the file to remove

Result

No explicit data struct returned, only option is success?, failure?, and status to see if the program exited properly.

Exit Status

Code Description
0 Success
1 Failure

Tested On

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