View Your Linux Distro Version From The Command Line

September 12, 2011 by
Filed under: command line, HowTo, linux, Ubuntu 

Many different Linux distributions will display their version information in one place or another in the GUI. If you need to pull this information quickly, it may just be easier to open a terminal window and find it from the command line.

You can view your distro's version information with the lsb_release command. To view all of the information available, use the -a switch.

lsb_release -a

This yields the following information when run on my netbook:

Affiliate Link
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 10.10
Release:	10.10
Codename:	maverick

You can eliminate the field names by adding the -s switch for short output.

lsb_release -as

Which gives this as output:

No LSB modules are available.
Ubuntu 10.10

Each field can also be extracted with its own switch as well;

  • -i for Distributor's ID
  • -d for Description
  • -r for Release
  • -c for Codename

For more information, check out the manual page for lsb_release.

man lsb_release


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>