Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-02-2009, 03:11 PM
|
#1
|
LQ Newbie
Registered: Mar 2009
Posts: 8
Rep:
|
How to show what distribution is installed?
Hi all,
It isn't a real software, but a shell scripting question.
I'm looking how it is possible to show what Linux distribution is installed. This should be done in a shell script.
I found "cat /etc/*release". But, does this work in all the major Linux distributions? And, how can I get that result in "one word"?
Thanks,
Kris
|
|
|
04-02-2009, 04:13 PM
|
#2
|
Member
Registered: Jul 2006
Distribution: Debian, Ubuntu, openSUSE, CentOS
Posts: 147
Rep:
|
Check /etc/issue as well.
|
|
|
04-02-2009, 04:16 PM
|
#3
|
LQ Newbie
Registered: Mar 2009
Posts: 8
Original Poster
Rep:
|
Thanks for your answer, rizwanrafique.
But, how can I test with a shell script what distribution it is?
Grtz,
Kris
|
|
|
04-02-2009, 04:29 PM
|
#4
|
Senior Member
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994
Rep:
|
This might help:
http://linuxmafia.com/faq/Admin/release-files.html
Of course, you should note that there are several thousand known distributions of Linux, and more appearing all the time, so if you're trying to do something that behaves differently on different distributions then you may have your work cut out for you
|
|
|
04-03-2009, 02:27 AM
|
#5
|
LQ Newbie
Registered: Mar 2009
Posts: 8
Original Poster
Rep:
|
Thanks for that list!
I just need the "major" distro's, so it isn't that much work.
Grtz,
Kris
|
|
|
04-03-2009, 07:41 AM
|
#6
|
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Rep: 
|
Something else that may be of use if the distro si lsb compliant..
Code:
user@it-lenny:~$ lsb_release -a
Distributor ID: Debian
Description: Debian GNU/Linux 5.0 (lenny)
Release: 5.0
Codename: lenny
man lsb_release for command line options
|
|
|
04-03-2009, 07:45 AM
|
#7
|
LQ Newbie
Registered: Mar 2009
Posts: 8
Original Poster
Rep:
|
Indeed, but that is not working for all distro's. Look eg at Fedora.
|
|
|
04-03-2009, 09:03 AM
|
#8
|
Member
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493
Rep:
|
Quote:
Originally Posted by Scormen
Indeed, but that is not working for all distro's. Look eg at Fedora.
|
For FEDORA core 8 it works, so I think that for more recent version it will work too...
|
|
|
All times are GMT -5. The time now is 10:12 PM.
|
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
|
|