by richard on Fri, 09/23/2011 - 17:44

So, I am working on a project where I need to be able to work out what version of linux a server is running.

Did a bit of googling, and found that /etc/debian_version shows it for debian, and there are similar files for other distros, but then stumbled across the command lsb_release.

lsb_release is an application that "provides certain LSB (Linux Standard Base) and distribution-specific information". Which is just what I need.

To use it, simple as lsb_release -a (shows all data), but you can also get it to show you more specific information.

Tags: