How to obtain the Linux Distribution Details ?


 
Thread Tools Search this Thread
Operating Systems Linux SuSE How to obtain the Linux Distribution Details ?
# 1  
Old 06-30-2008
How to obtain the Linux Distribution Details ?

Hi,

I am working on a Unix console.
I want to obtain the Linux distribution details in
1) Shell
2) C program ( System call )
Want to know if it is REDHAT / SUSE / UBUNTU , etc ..

Please let me know if there is any way to achieve this.

Thanks in advance,
Siva.
# 2  
Old 06-30-2008
With the uname command? Read the man page of uname.

Regards
# 3  
Old 06-30-2008
with uname command I can get only
Linux <kernel version> <time>
not the distribution details.

How ever referring to some manuals i received that /proc/version
gives the distribution details.

But not sure about the system call which helps to obtain these details
( details obtained from /proc ) into the C program. any help on this ?
# 4  
Old 06-30-2008
You can open and read it as a regular file and parse the desired fields in your program.
An alternative is to use popen and print the desired fields with cut or with awk.

Regards
# 5  
Old 06-30-2008
Not sure if this helps, but cat /etc/issue. That will usually show the human readable version.
# 6  
Old 07-02-2008
Find Linux distribution release information

if file /etc/SuSE-release exists
It is a SuSE and it contains the version information

if file /etc/redhat-release exists
It is a RedHat box and contains the version information

I am not sure how to do that on Ubuntu other than /etc/issue. I don't think Ubuntu comes with /etc/ubuntu-release file.

-Aby


Quote:
Originally Posted by Sivaswami
Hi,

I am working on a Unix console.
I want to obtain the Linux distribution details in
1) Shell
2) C program ( System call )
Want to know if it is REDHAT / SUSE / UBUNTU , etc ..

Please let me know if there is any way to achieve this.

Thanks in advance,
Siva.
# 7  
Old 07-14-2008
Hi All,

Thx for the information.
1) In few Linux machines uname -a fails to give the details of Linux Distribution ( eg: Ubuntu)
2) I think any one can alter the /etc/issue file and is not safe to access it always.

I digged more and found this.
cat /proc/version
it output same info as uname -a , but with additional info on the Linux Distribution.

Thx,
Siva.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

NTP server name and ip details on Linux/Solaris

Hi All, Where can I find all the NTP server names/ip addresses on Linux/Solaris systems. How can I grep these names/IP address from specific files from a specific OS (Linux/Solaris). I know on linux /etc/ntp.conf and /etc/ntp/ntp.conf on solaris contains these details. Whether I am right about... (4 Replies)
Discussion started by: sanzee007
4 Replies

2. Red Hat

Need to mount LUN on two linux boxs (one rw the other ro) caveat details inside

Calling all Linux GURU's. The purpose of this thread is to try an recreate what we already have stood up in my environment, however the steps i am having to produce my own. I have got multiple applications that dump the data to various LUNs, the LUNs are managed by an Enterprise SAN... (11 Replies)
Discussion started by: jcejka
11 Replies

3. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

4. UNIX for Advanced & Expert Users

UNIX / LINUX OS CPU configuration details

Hi, How to find the cpu configuration details of Cores, Speed MHz, virtual processors for the following servers: LINUX OS Servers: Linux 2.6.9-89.0.3.ELsmp #1 SMP Sat Jun 13 07:05:54 EDT 2009 i686 i686 i386 GNU/Linux. (Cores, Speed, Processor) Linux 2.6.18-164.el5 #1 SMP Tue Aug 18... (5 Replies)
Discussion started by: jagtheesh
5 Replies

5. UNIX for Advanced & Expert Users

Script to access multiple linux servers to get system details such as CPU usage

Hi Is there any shell script that accesses multiple linux servers to get details such as CPU usage, RAM used etc. The access of the servers must be parallel not serial in the sense it must ping all the servers at a time to get information.The script has to be triggered from a host system and get... (7 Replies)
Discussion started by: mssrivatsa
7 Replies

6. UNIX for Dummies Questions & Answers

What Linux distribution should I use?

Hey I am right now working on an old Compaq computer, and because I have a newer one I thought of installing Linux on this one. The thing is that I don't know which Linux distribution that would work with a minimum of lag. My computer specifications is: Compaq Presario 7000 Intel Pentium... (7 Replies)
Discussion started by: Sixmax
7 Replies

7. Shell Programming and Scripting

How to obtain system open file table value in Linux

Hello , I want to get current system open file table value. Can any one help. Thanking you, mahesh (0 Replies)
Discussion started by: mahesh.
0 Replies

8. UNIX for Dummies Questions & Answers

How to know which Linux Distribution i am using

Hi, I m working on many Linux servers in my project. But i am unable to know which Linux Distribution i am using Like whether i am using SUSE or REDHAT or MONDRAKE. I tried with "uname" command. But it does not help me. Please provide me the command if u know. Regards, Basavaraja KC (3 Replies)
Discussion started by: BasavarajaKC
3 Replies

9. UNIX for Dummies Questions & Answers

IP details for Unix/Linux login clients?

Hi there, I am wondering if by logging in to a unix system, if it is possible to get the IP address of the machine I am connecting FROM. I know how I can do this using the name server, but is this possible without a host lookup?:confused: Thanks, -ghoti (15 Replies)
Discussion started by: ghoti
15 Replies
Login or Register to Ask a Question