logoalt Hacker News

yjftsjthsd-hyesterday at 1:33 PM1 replyview on HN

> Protip, if you have access to the computer: `lsb_release -a` should list both release and codename. This command is not specific to Ubuntu.

I typically prefer

  cat /etc/os-release
which seems to be a little more portable / likely to work out of the box on many distros.

Replies

cesarbyesterday at 2:17 PM

That's only if the distro is recent enough; sooner or later, you'll encounter a box running a distro version from before /etc/os-release became the standard, and you'll have to look for the older distro-specific files like /etc/debian_version.

show 1 reply