Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to discover what Linux distribution is in use

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 times that even the "responsible" person for the server doesn't know).

Is there an easy and reliable way to discover that, one that is uniform and consistent across all of them?

like image 997
Seiti Avatar asked Sep 06 '25 12:09

Seiti


2 Answers

cat /etc/*release

Most distributions put a release file in /etc/ (like /etc/redhat-release, /etc/gentoo-release, etc.) which usually has the version number of your distribution in it.

like image 132
Evan Teran Avatar answered Sep 09 '25 03:09

Evan Teran


lsb_release -i may work for you.

More detail is available with lsb_release -a

Some discussion at http://etbe.coker.com.au/2007/08/30/identifying-the-distribution-of-a-linux-system/

like image 38
Adam Liss Avatar answered Sep 09 '25 04:09

Adam Liss