Kanrisuru

get_gid

Gets a group gid 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.get_gid('ubuntu')
result.success?
true

result.to_i
1000

Parameters

Field Type Description
group string
Required name of the group to get gid.

Result

Returns an integer of the group’s gid.

Exit Status

Code Description
0 Success
1 Missing arguments, or database unknown.
2 One or more supplied key could not be found in the database.
3 Enumeration not supported on this database.

Tested On

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