• 6TM
  • My links
  • Tags
  • pics
  • RSS
  • Login
Filter untagged links

Get Linux Distribution from commandlinehttps://sh.6tm.es/shaare/lYQT5g

  • Snippet
  • GNU/Linux
  • Distribution
  • Snippet
  • GNU/Linux
  • Distribution

[[ $(uname -s) = Linux ]] && awk -F'=' '/^ID/ {last = $2} END {if (last != "") print last}' /etc/*release || echo "It's not a Linux Distribution"

Get only last result from awk because for Archlinux, release file has two ID fields (ID and ID_LIKE).

Permalink
December 22, 2025 at 9:34:12 AM GMT+1
QRCode
archive.org
Shaarli 96 shaares · Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation · Theme : Stack · Font : DINish
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community