Skip to content
Latchkey

uname Command Reference: Flags, Usage & CI Examples

uname prints system information like OS, kernel, and architecture.

uname reports the operating system, kernel version, and machine architecture. In CI it drives portable scripts that download the right binary for the host OS and CPU.

Common flags and usage

  • -s: kernel/OS name (Linux, Darwin)
  • -m: machine hardware name (x86_64, aarch64, arm64)
  • -r: kernel release
  • -a: all available information
  • -o: operating system (GNU/Linux)

Example

shell
OS=$(uname -s)
ARCH=$(uname -m)
echo "downloading tool for ${OS}/${ARCH}"

In CI

uname -s and -m let one script pick the correct release asset across Linux and macOS runners and across x86_64 and arm64. Note the naming differs (Linux reports aarch64 where macOS reports arm64), so normalize before matching a download URL.

Key takeaways

  • uname reports OS, kernel, and CPU architecture.
  • -s and -m drive portable per-platform downloads.
  • Arch names differ (aarch64 vs arm64); normalize them.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →