![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to know which Linux Distribution i am using ? | BasavarajaKC | Shell Programming and Scripting | 5 | 07-04-2008 04:24 PM |
| What Linux distribution should I use? | Sixmax | UNIX for Dummies Questions & Answers | 7 | 05-27-2008 10:27 PM |
| How to obtain system open file table value in Linux | mahesh. | Shell Programming and Scripting | 0 | 05-25-2007 07:25 AM |
| How to know which Linux Distribution i am using | BasavarajaKC | UNIX for Dummies Questions & Answers | 3 | 06-02-2006 05:00 AM |
| IP details for Unix/Linux login clients? | ghoti | UNIX for Dummies Questions & Answers | 15 | 09-19-2001 08:04 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
With the uname command? Read the man page of uname.
Regards |
|
#3
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
Not sure if this helps, but cat /etc/issue. That will usually show the human readable version.
|
|
#6
|
|||
|
|||
|
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 |
|
#7
|
||||
|
||||
|
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. |
||||
| Google The UNIX and Linux Forums |