{"id":3799,"date":"2018-05-10T19:31:10","date_gmt":"2018-05-10T15:31:10","guid":{"rendered":"https:\/\/www.howtoforge.com\/linux-uname-command\/"},"modified":"2018-05-10T19:31:10","modified_gmt":"2018-05-10T15:31:10","slug":"linux-uname-command-tutorial-for-beginners-8-examples","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/linux-uname-command-tutorial-for-beginners-8-examples\/","title":{"rendered":"Linux uname Command Tutorial for Beginners (8 Examples)"},"content":{"rendered":"<p>Regardless of whether you are a system admin, software developer, or a normal Linux user, you may find yourself in a situation\u00a0where you need some system information like kernel release or version. Well, there exists a built-in command line utility &#8211; dubbed <strong>uname<\/strong> &#8211; that lets you do this.<\/p>\n<p>In this tutorial, we will discuss the basics of this tool using some easy to understand examples. But before we do that, it&#8217;s worth mentioning that all examples in the article have been tested on an Ubuntu 14.04 LTS machine.<\/p>\n<h2 id=\"linux-uname-command\">Linux uname command<\/h2>\n<p>As already mentioned, the uname command gives you system information. Following is its syntax:<\/p>\n<p class=\"command\">uname [OPTION]&#8230;<\/p>\n<p>And here&#8217;s how the man page defines it:<\/p>\n<pre>Print certain system information.<\/pre>\n<p>Following are some Q&amp;A-styled examples that should give you a good idea of how uname works.<\/p>\n<h2 id=\"q-how-to-use-uname\">Q1. How to use uname?<\/h2>\n<p>For basic usage, just execute the &#8216;uname&#8217; command sans options.<\/p>\n<p class=\"command\">uname<\/p>\n<p>On my system, the above command produced the following output:<\/p>\n<pre>Linux<\/pre>\n<h2 id=\"q-how-to-print-kernel-name\">Q2. How to print kernel name?<\/h2>\n<p>For this, use the -s command line option.<\/p>\n<p class=\"command\">uname -s<\/p>\n<p>The output on my system was:<\/p>\n<pre>Linux<\/pre>\n<p>So you can see this it&#8217;s the kernel name that the uname command produces by default as well (when no options are passed).<\/p>\n<h2 id=\"q-how-to-print-kernel-release\">Q3. How to print kernel release?<\/h2>\n<p>Use the -r option for this.<\/p>\n<p class=\"command\">uname -r<\/p>\n<p>For example, on my system, the following output was produced:<\/p>\n<p class=\"command\">4.4.0-62-generic<\/p>\n<h2 id=\"q-how-to-print-kernel-version\">Q4. How to print kernel version?<\/h2>\n<p>Kernel version can be accessed by using the -v command line option.<\/p>\n<p class=\"command\">uname -v<\/p>\n<p>Here&#8217;s the output from my machine:<\/p>\n<pre>#83~14.04.1-Ubuntu SMP Wed Jan 18 18:10:26 UTC 2017<\/pre>\n<h2 id=\"q-how-to-print-network-node-hostname\">Q5. How to print network node hostname?<\/h2>\n<p>The -n command line option lets you print this info.<\/p>\n<p class=\"command\">uname -n<\/p>\n<p>For example, following is the output the above command produced on my system:<\/p>\n<pre>himanshu-desktop<\/pre>\n<h2 id=\"q-how-to-print-machine-hardware-name\">Q6. How to print machine hardware name?<\/h2>\n<p>The -m option allows uname to print the machine hardware name.<\/p>\n<p class=\"command\">uname -m<\/p>\n<p>Here&#8217;s the output the above command produced on my system:<\/p>\n<pre>i686<\/pre>\n<h2 id=\"q-how-to-print-processor-type\">Q7. How to print processor type?<\/h2>\n<p>To get processor type in output, use the -p command line option.<\/p>\n<p class=\"command\">uname -p<\/p>\n<p>On my system, the following output was produced:<\/p>\n<pre>athlon<\/pre>\n<h2 id=\"q-how-to-print-hardware-platform\">Q8. How to print hardware platform?<\/h2>\n<p>Information related to hardware platform can be accessed using the -i option.<\/p>\n<p class=\"command\">uname -i<\/p>\n<p>On my system, the output was same as what it was in case of the -m command line option &#8211; i686.<\/p>\n<h2 id=\"q-how-to-print-operating-system\">Q9. How to print operating system?<\/h2>\n<p>Use the -o command line option in case you want to fetch the OS name.<\/p>\n<p class=\"command\">uname -o<\/p>\n<p>Following output was produced on my Ubuntu machine:<\/p>\n<pre>GNU\/Linux<\/pre>\n<h2 id=\"q-how-to-print-all-information-in-one-go\">Q10. How to print all information in one go?<\/h2>\n<p>If you wish, you can also print all the information &#8211; that we&#8217;ve accessed through individual options so far &#8211; in one go. For this, use the -a option.<\/p>\n<p class=\"command\">uname -a<\/p>\n<p>Here&#8217;s the output produced on my system:<\/p>\n<pre>Linux himanshu-desktop 4.4.0-62-generic #83~14.04.1-Ubuntu SMP Wed Jan 18 18:10:26 UTC 2017 i686 athlon i686 GNU\/Linux<\/pre>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>As you&#8217;d agree, uname is a command that&#8217;s fairly easy to understand and use. The only thing you need to keep in mind is its command line options &#8211; when to use which. Practice the options we&#8217;ve discussed in this tutorial, and for more info on the tool, head to its <a href=\"https:\/\/linux.die.net\/man\/1\/uname\" target=\"_blank\" rel=\"noopener noreferrer\">man page<\/a>.<\/p>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Flinux-uname-command%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/05\/linux-uname-command-tutorial-for-beginners-8-examples.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Flinux-uname-command%2F&amp;text=Linux+uname+Command+Tutorial+for+Beginners+%288+Examples%29&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/05\/linux-uname-command-tutorial-for-beginners-8-examples-1.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/05\/linux-uname-command-tutorial-for-beginners-8-examples-2.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Flinux-uname-command%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/05\/linux-uname-command-tutorial-for-beginners-8-examples-3.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Regardless of whether you are a system admin, software developer, or a normal Linux user, you may find yourself in a situation\u00a0where you need some system information like kernel release or version. Well, there exists a built-in command line utility &#8211; dubbed uname &#8211; that lets you do this. In this tutorial, we will discuss &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-3799","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/3799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=3799"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/3799\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=3799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=3799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=3799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}