Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Are you sure +-release works? Effectively you're looking assuming it will be /etc/lsb-release, so perhaps just call it that. Commented Jan 24, 2011 at 5:57
  • @Mikel: I replaced * with + to avoid the comment formating, it should be etc/*-release, it seems to work. Commented Jan 24, 2011 at 6:20
  • 10
    Never introduce a syntax error to get formatting right. Besides, the formatting is wrong only in the preview, the final view picks up the syntax from the tags. Commented Jan 24, 2011 at 21:07
  • Why no one mention this f.e. uname -rv | grep -i "name_of_distro" and use exit code? Commented Feb 6, 2017 at 14:21
  • $ awk -F= '$1 ~ /ID|VERSION_ID/ {print $2;}' /etc/os-release; or awk -F= '$1 ~ /DISTRIB_ID|DISTRIB_RELEASE/ {print $2;}' /etc/lsb-release Commented Aug 11, 2021 at 13:35