APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > What is the shell command to determine the version of Unix or Linux that is currently running?
Printer Friendly Version




News Group Posts


What is the shell command to determine the version of Unix or Linux that is currently running?

What is the shell command to determine the number of CPU's?



Version

Usually some variant of uname, often "uname -a", but all sorts of other possibilies: -v, -X .. who knows? Depends on the flavor and in some cases even the version of that flavor.

Sometimes /etc/issue has what you want.. and on some systems a "cat *-release" or "cat *-version" may give results.

Oh, and one more thing:

Even when the man page tells you that uname -v gives you the version, it can be an entirely different interpretation of version than what you would think.

For example, on this 2.4 kernel Red Hat box, uname -r says 2.4.9-21. That's good. But uname -v gives "#1" and todays date (yes, I did build a new kernel today)

This 2.6 Linux shows me that PAEis enable with "-r": "2.6.18-238.5.1.el5PAE"












On the SCO system I'm trying to recover for a client to my left, uname -r says 3.2 and uname -v says "2", but uname -X says "Release=3.2v5.0.4" (and "5.0.4" is what's important there)

On the BSD box to my right, uname -r says 4.1.1-STABLE and -v says that and more.

Can't trust it unless you already know how it works :-)

Linux users can also "cat /proc/version", which is likely to give you something like this:

Linux version 2.6.18-238.5.1.el5PAE
(mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2
20080704 (Red Hat 4.1.2-50)) #1 SMP Mon Feb 21 06:01:16
EST 2011
 

CPU Info

For Linux, it's all in /proc/cpuinfo. If you only care about the number, "grep processor /proc/cpuinfo" will give you that.

Unixware and SunOS have "psrinfo", which will tell you about processors.

Unixware "idtype" will tell you the kind of kernel it is running (for example, whether or not SMP).

Speaking of cpu stuff, this How do I Find Out Linux CPU Utilization? is useful.

If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

Comments?




More Articles by



Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide


 I sell and support
 Kerio Mail server
pavatar.jpg

This post tagged:

       - Kernel
       - Linux
       - MacOSX
       - SCO_OSR5
       - Scripting
       - Shell
       - Unixware




Unix/Linux Consultants

Skills Tests

Guest Post Here