There comes a time in every Linux user’s life when they need a refresher as to what version of a Linux distro they are currently running. Fortunately there is a quick and easy utility for pulling the distribution-specific information” called ‘lsb_release‘.

You can look up the manual page for more detailed information (man lsb_release) and a run through of the various switches, but if you simply need the distro name and version number you can use the following command:

lsb_release -d

..and you should receive something similar to this:

Description: Ubuntu 12.04.2 LTS

Another useful use of this utility is to grab the “codename” of the distro you are running. This can be especially handy when running Ubuntu as they use a random word based on a particular letter of the alphabet.
In order to pull this info using the lsb_release utility enter:

lsb_release -c

…and receive the codename of your distro:

Codename: precise

Stay tuned for more command line utilities that help with everyday tasks! I will be categorizing them all under the category ‘Linux Commands’ for easy reference. If you have any requests or suggestions, be sure to comment and I will create articles based on those suggestions.

Leave a Reply

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