Information about your Unix system might come in handy if you’re planning to try some new software or need to figure out system idiosyncrasies. Some systems tell you this information when you log in. Sometimes, however, especially if you’re using an ISP, you may not have been told any particulars about the Unix system. You can easily find out what kind of Unix system you’re using with uname, as shown in Code Listings 7.1 and 7.2.
ejray@home $ ssh frizz Last login: Wed Oct 10 09:59:09 from frazz Sun Microsystems Inc. SunOS 5.9 Generic → May 2002 ejray@frizz $ uname SunOS ejray@frizz $ uname -sr SunOS 5.9 ejray@frizz $ uname -a SunOS frizz 5.9 Generic_112233-01 sun4u → sparc SUNW,Ultra-5_10 |
1. | uname To begin, type uname to find out what kind of a system you’re on. The Unix system in Code Listings 7.1 and 7.2 is Solaris (aka, SunOS). Other common systems (not an exhaustive list, by any means) are Linux, AIX, BSD, and HP/UX. |
2. | uname -sr Add the -sr flags to the command, yielding uname -sr, to find out both the operating system type and the release level. This is useful to find out whether specific software is compatible with the operating system. |
3. | uname -a For the whole nine yards, use uname -a to print all information, including the operating system type, host name, version, and hardware. The specifics you get here will vary a bit from system to system. |
ejray@frazz $ uname Linux ejray@frazz $ uname -sr Linux 2.4.19-16mdk ejray@frazz $ uname -a Linux frazz.raycomm.com2.4.19-16mdk #1 Fri → Sep 20 18:15:05 CEST 2002 i686 unknown → unknown GNU/Linux ejray@frazz $ |