If you need to check the version and flavour of the running Linux instance, then you can try the below commands:

cat /etc/os-release
lsb_release -a
hostnamectl

I use these all the time when SSH’ing into servers I didn’t set up — you need to know the distro before installing packages since the package manager and package names differ between Ubuntu, CentOS, Amazon Linux, etc. The /etc/os-release file is the most reliable option since it exists on virtually all modern distros. lsb_release gives cleaner output but isn’t always installed by default. hostnamectl is a bonus since it also shows the kernel version and architecture alongside the OS info.