Here are the methods and commands to check ubuntu version
1. Using the lsb_release -a command
2. Checking the file /etc/lsb-release or /etc/os-release
3. Checking the file /etc/issue
4. Using the hostnamctl command
1. Using the lsb release -a command
lsb_release -a
2. Checking the file /etc/lsb-release or /etc/os-release
cat /etc/lsb-release
or
cat /etc/os-release
3. Checking the /etc/issue file
cat /etc/issue
4. Using the hostnamectl command
hostnamectl