5+ “uname” Command Usage Examples in Linux

«
»

This tutorial explains Linux “uname” command, options and its usage with examples.

uname – print system information

DESCRIPTION

advertisement

This command is useful for obtaining certain hardware information.

SYNOPSIS

uname [OPTION]

OPTIONS :

-a, –all
print all information, in the following order:
-s, –kernel-name
print the kernel name
-n, –nodename
print the network node hostname
-r, –kernel-release
print the kernel release
-v, –kernel-version
print the kernel version
-m, –machine
print the machine hardware name
-p, –processor
print the processor type
-i, –hardware-platform
print the hardware platform
-o, –operating-system
print the operating system

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
advertisement
advertisement

EXAMPLES

Note : for information regarding various options, see above

1. Printing general system information

$ uname
Linux

2. Printing all system information

advertisement
$ uname -a
Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

3. Printing machine hardware name

$ uname -m
x86_64

4. Printing hardware platform information

$ uname -i
x86_64

5. Printing kernel name

advertisement
$ uname -s
Linux

6. Printing network host name

$ uname -n
ubuntu

7. Printing kernel release information

advertisement
$ uname -r
3.8.0-19-generic

8. Printing kernel version information

$ uname -v
#29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013

9. Using multiple options together

$ uname -prnv
ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64

Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.

If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.