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

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.

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!
advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter