Linux.com

Home Learn Linux Linux Documentation Finding the OS Version & Distribution in Linux

Finding the OS Version & Distribution in Linux

When supporting systems you have inherited or in environments that have many different OS versions and distributions of Linux. There are times when you simply don’t know off hand what OS version or distribution the server you are logged into is.

Luckily there is a simple way to figure that out.

 

Ubuntu/Debian

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"

 

Read more at bc-log
 

Comments

Subscribe to Comments Feed
  • xtraeme Said:

    This will only works on systems providing this file... there are distributions that don't rely on LSB and simply switched to the systemd way: cat /etc/os-release

  • Stuferus Said:

    i only see /etc/slackware-version ;)

  • tdmsilvino Said:

    Slackware ships /etc/os-release as well.

Upcoming Linux Foundation Courses

  1. LFS230 Linux Network Management
    06 Oct » 09 Oct - Virtual
    Details
  2. LFD331 Developing Linux Device Drivers
    13 Oct » 17 Oct - Virtual
    Details
  3. LFS430 Linux Enterprise Automation
    13 Oct » 16 Oct - Virtual
    Details

View All Upcoming Courses

Become an Individual Member
Check out the Friday Funnies

Sign Up For the Linux.com Newsletter


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board