Below is the command to check/find the ubuntu version using hostnamectl:
hostnamectl
The output will be like this:
Static hostname: ip-11-223-44-55
Icon name: computer-vm
Chassis: vm
Machine ID: 8470f217a1343f9cdcd47d
Boot ID: 455304e80483e828b83a8867
Virtualization: xen
Operating System: Ubuntu 20.04.4 LTS
Kernel: Linux 5.15.0-1015-aws
Architecture: x86-64
Aove result displays the version of Ubuntu installed and that is Ubuntu 20.04.4 LTS