Sometimes I need to access some servers running Linux (or maybe another Unix-like SO), but I don\'t know how to verify which distribution is in use on the server (there are
This is, annoyingly, a harder problem than it appears.
For Linux systems, use lsb_release.
$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.04.1
Release: 8.04
Codename: hardy
$ lsb_release -i
Distributor ID: Ubuntu
This has the limitation that lsb_release works only for Linux releases.
For all Unix systems, you can also parse up uname.
$ uname -a
Linux blue-laptop 2.6.24-21-generic #1 SMP Tue Oct 21 23:43:45 UTC 2008 i686 GNU/Linux
You can find some information about the systems and distributions at the uname Wikipedia page.