Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

os_info

> 编程语言
Open source

Rust library to detect the operating system type

200 stars0 likes0 views
WebsiteGitHub

About

Rust library to detect the operating system type

os_info

Status: Project info: Project details:

Overview

This project consists of two parts: the library that can be used to detect the operating system type (including version and bitness) and the command line tool that uses the library.

Library (os_info)

os_info usage

To use this crate, add os_info as a dependency to your project's Cargo.toml:

toml
[dependencies]
os_info = "3"

This project has serde as an optional dependency, so if you don't need it, then you can speed up compilation disabling it:

toml
[dependencies]
os_info = { version = "3", default-features = false }

Example

rust
let info = os_info::get();

// Print full information:
println!("OS information: {info}");

// Print information separately:
println!("Type: {}", info.os_type());
println!("Version: {}", info.version());
println!("Bitness: {}", info.bitness());
println!("Architecture: {}", info.architecture());

Command line tool (os_info_cli)

A simple wrapper around the os_info library.

Installation

This tool can be installed using the following cargo command:

bash
cargo install os_info_cli

os_info_cli usage

Despite being named os_info_cli during installation, it is actually named os_info. You can use the --help flag to see available options:

bash
os_info --help

Supported operating systems

Right now, the following operating system types can be returned:

  • AIX
  • AlmaLinux
  • Alpaquita Linux
  • Alpine Linux
  • Amazon Linux AMI
  • Android
  • AOSC OS
  • Arch Linux
  • Artix Linux
  • Azure Linux
  • Bazzite
  • CachyOS
  • CentOS
  • Debian
  • DragonFly BSD
  • Elementary OS
  • Emscripten
  • EndeavourOS
  • Fedora
  • FreeBSD
  • Garuda Linux
  • Gentoo Linux
  • HardenedBSD
  • Hurd
  • illumos
  • iOS
  • Kali Linux
  • KDE neon
  • Linux
  • Mabox
  • macOS (Mac OS X or OS X)
  • Manjaro
  • Mariner
  • MidnightBSD
  • Mint
  • NetBSD
  • NixOS
  • Nobara Linux
  • OpenBSD
  • OpenCloudOS
  • openEuler (EulerOS)
  • openSUSE
  • Oracle Linux
  • Parrot OS
  • Pop!_OS
  • Raspberry Pi OS
  • Red Hat Linux
  • Red Hat Enterprise Linux
  • Redox
  • Rocky Linux
  • Solus
  • SUSE Linux Enterprise Server
  • Ubuntu
  • Ultramarine Linux
  • Unknown
  • Void Linux
  • Windows

If you need support for more OS types, I am looking forward to your Pull Request.

License

os_info is licensed under the MIT license. See LICENSE for the details.

Issues· 34 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言