uname command – print Unix system information
uname command is one of the most useful commands when it comes to gathering basic information about your Unix/Linux system. You can use it to find out the hostname of the system you’re on, the hardware architectures supported by the currently used kernel and the exact release of your system.
Basic uname usage
uname -n
This command shows you the node (host) name of your system:
{% highlight command %} bash-3.00$ uname -n samplehost {% endhighlight %}
uname -i
If you’re interested in confirming the hardware platform of your system, this is the command to use.
For Linux, it will return i386 for 32-bit processors or x86_64 for 64-bit ones. For Solaris, it will confirm the actual server type used:
{% highlight command %} bash-3.00$ uname -i SUNW,Sun-Fire-V490 {% endhighlight %}
Release and version of the Unix kernel
To find out the release and version of your Unix kernel, you need to use uname -r and uname -v.
uname -r
This allows you to confirm the release of Unix kernel used in your OS.
On Linux, it looks like this:
{% highlight command %} bash-3.00$ uname -r 2.6.18-8.el5 {% endhighlight %}
On Solaris, it’s much shorter and more meaningful, at it gives you the version of Solaris, and not the kernel (this example is for Solaris 10):
{% highlight command %} bash-3.00$ uname -r 5.10 {% endhighlight %}
For the version of Unix kernel, use uname -v:
{% highlight command %} bash-3.1$ uname -v #1 SMP Fri Jan 26 14:15:14 EST 2007 {% endhighlight %}
Typical Solaris output:
{% highlight command %} bash-3.00$ uname -v Generic_127111-01 {% endhighlight %}
Common uname usage
uname -a
Most usually, you simply use uname to output everything it knows about your system.
On Linux it looks like this:
{% highlight command %} bash-3.00$ uname -a Linux samplehost 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:14 EST 2007 x86_64 x86_64 x86_64 GNU/Linux {% endhighlight %}
On Solaris, uname -a output should be similar to this:
{% highlight command %} bash-3.00$ uname -a SunOS samplehost 5.10 Generic_127111-01 sun4u sparc SUNW,Sun-Fire-V490 {% endhighlight %}
See Also
- How to Find the Release Version of your Unix
- Basic Unix Commands
- Unix System Monitoring Commands
- Commands in Unix
- How to Find Out RedHat version
- Advanced Unix Commands
- Check CentOS Version