Get gnome version via command

We can find gnome version by checking the name of package which was installed.

For Centos/Rhel:

[j@server01 ~]$ rpm -qa | grep -i gnome-desktop
gnome-desktop3-3.32.2-1.el8.x86_64

For Debian/Ubuntu:

j@ubuntu:/usr/share/gnome$ apt list --installed | grep gnome-desktop

gnome-desktop3-data/now 3.36.3.1-0ubuntu1 all [installed,upgradable to: 3.36.8-0ubuntu1]

Get gnome version from file gnome-version.xml

For gnome 3 ,the file location is :

[j@server01 ~]$ cat /usr/share/gnome/gnome-version.xml 
<?xml version="1.0"?>
<gnome-version>
 <platform>3</platform>
 <minor>32</minor>
 <micro>2</micro>
 <distributor>GNOME.Org</distributor>
 <date>2019-11-08</date>

For gnome 2 ,the file location is :

/usr/share/gnome-about/gnome-version.xml

Get gnome version via setting panel

Click “activities” then search “about” ,below is an example of ubuntu 20.04