uname—prints name of current machine

uname [ –amnprsv ]
uname [ –S system_name ]

uname prints information about the current system on the standard output. If no options are specified, uname prints the current operating system's name. The options print selected information returned by uname(2) and/or sysinfo(2).

Example A.67.
1  uname -n
2  uname -a
				

Explanation

  1. Prints the name of the host machine.

  2. Prints the machine hardware name, network nodename, operating system release number, the operating system name, and the operating system version—same as -m, -n, -r, -s, and -v.

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.