Linux find os name/version command line

 

To find OS name and version use following command:

$ cat /etc/*-release

Output:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION=”Ubuntu 10.04 LTS”

              or

$ lsb_release -a

Output:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid

-Sany

4 comments on “Linux find os name/version command line

  1. On an rpm-based distribution, I recommend this:

    $ rpm -qf –qf=’%{NAME} %{VERSION} %{VENDOR} %{DISTRIBUTION}\n’ /etc/*-release
    fedora-release 16 Fedora Project Fedora Project
    fedora-release 16 Fedora Project Fedora Project
    fedora-release 16 Fedora Project Fedora Project

    The string content of the actual files sometimes gets munged but the RPM database does not lie. At least, not as much.

    Tommy

  2. Pingback: Linux – Command to find system architecture | Sany's Linux and Open Source Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s