Uname -a VS cat /etc/*release

When I use command “uname -a” it shows I got ubuntu but if I use command “cat /etc/*release” it shows i got centos.
SO how would I know what distro I got?

You are running this command in the labs, right?

And you are seeing something like this for uname -a?

Linux centos-host 5.4.0-1106-gcp #115~18.04.1-Ubuntu SMP Mon May 22 20:46:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

The labs run in containers, and a containerized distro uses the kernel of the host operating system, that being the machine that’s running docker (or kubernetes). That machine will be Ubuntu.

Know that the underlying kernel itself is the same in all Linux distros, and is developed and released by the Linux Kernel development team. All that makes up a distro is the software installed on top of the kernel, and the distro makers like RedHat and Ubuntu all take from the same kernel releases. The kernel is the free and open source part of Linux. You pay money for distros like RedHat Enterprise.

To get the distro, use the values in /etc/os-release

1 Like