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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
10-26-2009, 12:14 AM
|
#1
|
|
Member
Registered: Sep 2009
Posts: 673
Rep:
|
Which command to use to find name of operating system
Hi guys how would i know which distribution of unix i have installed in my machine?
|
|
|
|
10-26-2009, 12:29 AM
|
#2
|
|
Member
Registered: Sep 2009
Location: Phoenix, AZ
Distribution: Gentoo, Debian, Ubuntu
Posts: 121
Rep:
|
or if you want to know the particular kernel,
Last edited by sploot; 10-26-2009 at 12:30 AM.
|
|
|
|
10-26-2009, 12:39 AM
|
#3
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
There is no way which works on all Linux systems. See this post for one way of doing it.
|
|
|
|
10-26-2009, 12:40 AM
|
#4
|
|
LQ Newbie
Registered: Oct 2009
Location: Lansing
Distribution: #!
Posts: 2
Rep:
|
assuming it's a red-hat variant you can use
Code:
cat /etc/redhat-release
|
|
|
|
10-26-2009, 12:52 AM
|
#5
|
|
Member
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Rep:
|
You can also do 'cat /proc/version'
in my distro 'cat /etc/sabayon-release' will work, well, just like RH above.
Catkin is correct there is no universal way to do this on various distros. Just follow his link.
Btw, one of my distro is not listed there 
|
|
|
|
10-26-2009, 01:17 AM
|
#6
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Quote:
Originally Posted by hurry_hui
Btw, one of my distro is not listed there 
|
Which one and how could the function be modified to test for it?
|
|
|
|
10-26-2009, 01:24 AM
|
#7
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
lsb_release -a though should work on major distributions.
|
|
|
|
10-26-2009, 01:57 AM
|
#8
|
|
Member
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Rep:
|
Quote:
Originally Posted by catkin
Which one and how could the function be modified to test for it?
|
/etc/sabayon-release not available.
maybe adding
Code:
elif [[ -r '/etc/sabayon-release' ]]; then
n='Sabayon'
Sorry, I am not good at programming.
|
|
|
|
10-26-2009, 03:19 AM
|
#9
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Quote:
Originally Posted by linuxlover.chaitanya
lsb_release -a though should work on major distributions.
|
lsb_release has been in the Linux Standard Base (LSB) Core Specification since no later than 2004 when 2.0.1 was published and probably earlier. It would be interesting to know how many distros support it. It is not on my Slackware 13.0 system.
|
|
|
|
10-26-2009, 03:22 AM
|
#10
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Quote:
Originally Posted by hurry_hui
Sorry, I am not good at programming.
|
But it looks perfect! Sabayon added to the original function now. Thanks for the info.
|
|
|
|
10-26-2009, 03:38 AM
|
#11
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
I find it on my Ubuntu, RHEL and CentOS. I do not have any other distribution at hand.
|
|
|
|
10-26-2009, 11:01 AM
|
#12
|
|
Member
Registered: Sep 2009
Location: Phoenix, AZ
Distribution: Gentoo, Debian, Ubuntu
Posts: 121
Rep:
|
I wasn't aware that uname didnt work on all linux systems. Good to know 
|
|
|
|
10-26-2009, 11:13 AM
|
#13
|
|
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Laptop: Slackware 14.0 // Desktop: Slackware64 14.0 // Netbook: Slackware 14.0
Posts: 6,176
|
Quote:
Originally Posted by sploot
I wasn't aware that uname didnt work on all linux systems. Good to know 
|
It works, but doesn't tell you the distro:
Code:
Linux Slacklap 2.6.29.6-smp #1 SMP Mon Aug 17 00:18:05 CDT 2009 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux
|
|
|
|
10-26-2009, 11:14 AM
|
#14
|
|
Member
Registered: Sep 2009
Location: Phoenix, AZ
Distribution: Gentoo, Debian, Ubuntu
Posts: 121
Rep:
|
But it does tell Linux, Unix, BSD, etc. right? Maybe I misunderstood the OP's question. But I think I understand what he was going for now.
|
|
|
|
10-26-2009, 06:24 PM
|
#15
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 14,973
|
On Linux, i get 'Linux' & kernel version and various other things like SMP, 32/64 bit; depending on distro.
On HP I get HP-UX & release info; Solaris says SunOS, fqdn & version num etc.
Haven't got a BSD to look at.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:11 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|