uname command prints information about your system and its kernel. Listing 14 shows the various options for
uname and the resulting information; each option is defined in Table 3.
[ian@echidna ~]$ uname Linux [ian@echidna ~]$ uname -s Linux [ian@echidna ~]$ uname -n echidna.raleigh.ibm.com [ian@echidna ~]$ uname -r 220.127.116.11-217.2.3.fc11.i686.PAE [ian@echidna ~]$ uname -v #1 SMP Wed Jul 29 16:05:22 EDT 2009 [ian@echidna ~]$ uname -m i686 [ian@echidna ~]$ uname -o GNU/Linux [ian@echidna ~]$ uname -a Linux echidna.raleigh.ibm.com 18.104.22.168-217.2.3.fc11.i686.PAE #1 SMP Wed Jul 29 16:05:22 EDT 2009 i686 i686 i386 GNU/Linux
|-s||Print the kernel name. This is the default if no option is specified.|
|-n||Print the nodename or hostname.|
|-r||Print the release of the kernel. This option is often used with module-handling commands.|
|-v||Print the version of the kernel.|
|-m||Print the machine’s hardware (CPU) name.|
|-o||Print the operating system name.|
|-a||Print all of the above information.|
Listing 14 is from an Fedora 11 system running on an Intel® CPU. The
uname command is available on most UNIX® and UNIX-like systems as well as Linux. The information printed will vary by Linux distribution and version as well as by the type of machine you are running on. Listing 15 shows the output from an AMD Athlon 64 system running Ubuntu 9.04.