Skip to main content

Command Palette

Search for a command to run...

Cheatsheet & Examples: uname

Updated
2 min read
H

I am a developer from Malaysia. I work with PHP most of the time, recently I fell in love with Go. When I am not working, I will be ballroom dancing :-)

The uname command displays information about the operating system. It provides details like the kernel name, hostname, operating system release, version, and hardware architecture.

Display the kernel name

Example Usage: uname

What it does: Prints the name of the operating system's kernel. This is the most basic and common usage.

Command-line Arguments Explained:

  • No arguments are needed for this default behavior.

Display the kernel name, the node hostname, the kernel release, the kernel version, the machine hardware name, and the operating system

Example Usage: uname -a

What it does: Displays all available system information in a single line. This is the most comprehensive output.

Command-line Arguments Explained:

  • -a: Displays all system information in a single line.

Display the kernel release

Example Usage: uname -r

What it does: Prints the kernel release information, which often includes the version numbers and build details.

Command-line Arguments Explained:

  • -r: Displays the kernel release information.

Display the machine hardware name

Example Usage: uname -m

What it does: Prints the hardware architecture or machine type. This indicates the type of processor your system is using (e.g., x86_64, i686, ARM).

Command-line Arguments Explained:

  • -m: Displays the machine hardware name.

Display the operating system

Example Usage: uname -s

What it does: Prints the kernel name (same as uname without arguments).

Command-line Arguments Explained:

  • -s: Displays the operating system name.

Display the node hostname

Example Usage: uname -n

What it does: Prints the hostname of the system.

Command-line Arguments Explained:

  • -n: Displays the node hostname.

Display the kernel version

Example Usage: uname -v

What it does: Prints the kernel version. This provides the specific version and build information of the kernel.

Command-line Arguments Explained:

  • -v: Displays the kernel version.

Show help

Example Usage: uname --help

What it does: Displays a help message with all possible options of the uname command.

Command-line Arguments Explained:

  • --help: Displays the help message.

More from this blog

Hong's Tech Blog

110 posts

The blog is older than you know. I prefer counting from the emergence of one integral anomaly to the emergence of the next, in which case this is the forth version.