LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2011, 10:39 AM   #1
govindannv
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Any direct command to know the linux distro and version ?


Apart from, uname -a and checking /etc/*release* file, is there any direct command that will tell me the linux distro and the version running on the machine ?
 
Old 03-24-2011, 10:45 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello and Welcome to LinuxQuestions,

This one should work for all distros and versions since it gets its information from boot time messages:
Code:
dmesg |head -2
My output is:
Code:
Initializing cgroup subsys cpu
Linux version 2.6.37-4.dmz.1-liquorix-amd64 (Debian 2.6.37-15) (damentz@gmail.com) (gcc version 4.4.5 (Debian 4.4.5-14) ) #1 ZEN SMP PREEMPT Mon Mar 14 19:51:36 CDT 2011
which provides quite a bit of information about what you're running.


Hope that helps. Have fun with Linux.

Kind regards,

Eric
 
Old 03-24-2011, 10:55 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,518

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi,

Some distros (mostly redhat and debian based) have the command lsb_release. You can use it like:
Code:
lsb_release -a
Cheers
 
1 members found this post helpful.
Old 03-24-2011, 10:55 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Not always available, but in addition you can try:
Code:
lsb_release -a
Edit: beaten by bathory for a bunch of seconds!
 
Old 03-24-2011, 11:05 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Oeps, misinterpreted OP, he was asking for Linux distro and version. Of course, as pointed out by our distinguished Guru / Mod, lsb_release provides that information, albeit not always detailed. Mine from Linux Mint Debian Edition shows Release 1 which is a bit confusing since my version is 10. Apparently (from LMDE forums) the lsb_release only gets used by mintupdate so no harm at all but doesn't take away the confusion, specially for newbies.

Kind regards,

Eric
 
1 members found this post helpful.
Old 03-24-2011, 11:09 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by EricTRA View Post
Mine from Linux Mint Debian Edition shows Release 1 which is a bit confusing since my version is 10. Apparently (from LMDE forums) the lsb_release only gets used by mintupdate so no harm at all but doesn't take away the confusion, specially for newbies.
Thanks for pointing it out, Eric. Indeed the most reliable solution is to cat the /etc/*release file.
 
Old 03-25-2011, 01:21 AM   #7
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
"cat /etc/issue" might also do the trick.
 
Old 05-06-2011, 07:56 AM   #8
govindannv
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you all for resolving my query. :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux command for direct disk access idamien Linux - Software 2 05-21-2007 12:22 AM
Howto know the linux distro version? kumarkumar Linux - General 6 02-11-2007 01:40 AM
what distro/version of linux would be best for me? seanz6688 Linux - Newbie 10 02-26-2004 01:47 PM
which linux distro and version for a p200 ? nimrod Linux - Distributions 6 03-22-2003 03:51 AM


All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration