Shard Detail

unixium v0.1.0

Provides various useful utilities on Unix-based systems for Crystal.
users groups files permissions terminal work-in-progress experimental

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development

  github: fgimian/



The Unixium library provides the following useful functions for Unix systems:

  • Access to a Unix-based system's user, shadow and group databases
  • Obtain the Terminal size in rows and columns
  • Lots more to come!

Note: This library is still being developed and will likely undergo various major changes over the coming months until we reach a stable release. Please use as a reference only at this point.


Add this to your application's shard.yml:

    github: fgimian/


require "unixium"

# Obtain all users on the system
Unixium::Users.all.each do |user|
  puts "Username: #{}"
  puts "Password: #{user.passwd}"
  puts "UID: #{user.uid}"
  puts "GID: #{user.gid}"
  puts "GECOS: #{user.gecos}"
  puts "Home Directory: #{user.dir}"
  puts "Shell: #{}"

# Obtain an individual user by their username or uid
fots = Unixium::Users.get("fots")
fots = Unixium::Users.get(501)

# Obtain all groups on the system
Unixium::Groups.all.each do |group|
  puts "Name: #{}"
  puts "Password: #{group.passwd}"
  puts "GID: #{group.gid}"
  puts "Members: #{group.members}"

# Obtain an group user by their name or gid
staff = Unixium::Groups.get("staff")
staff = Unixium::Groups.get(20)

# TODO: Add instructions on shadow usage when it's implemented

# Obtain the Terminal size
termsize = Unixium::Terminal.size
puts "Your terminal has #{termsize.rows} rows and #{termsize.columns} columns"


TODO: Write development instructions here


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  • fgimian Fotis Gimian - creator, maintainer