Advertisement

Querying Linux OS version info

Started by October 11, 2003 05:23 PM
2 comments, last by Baraclese 21 years, 3 months ago
Is there a function similar to the Windows function GetVersionEx() to query general OS info like distributor, build number, etc.?
Most people would probably use ''uname -a''. The returned string should properly report all the goodies you want.

For the C/C++ header and functions, take a look at ''man 3 uname''.

Int.
Advertisement
distro version varies. search for a file called *-version or *-release in /etc that should have version information it it.

build number doesn''t exist. version of rpms installed can be found somehow. debs too. never looked into this. I''d probably just use the ''rpm'' and ''dpkg'' directly to find out.

uname will find KERNEL information.

In general, the answer to a question like this is to say, You''re thinking like a windows programmer. You don''t need to know any of that. Unless you do, maybe you should tell us what you''re trying to do, so we can tell you if you need to know.
Try
cat /proc/version 

SpiffGQ

This topic is closed to new replies.

Advertisement