# Cheat Sheet #day54 - uname

# `uname` Command Cheatsheet

The `uname` command in Unix/Linux is used to display system information. It provides details about the operating system and the hardware on which it is running.

## Syntax

```bash
uname [OPTION]...
```

## Common Options

* `-s`: Print the kernel name.
    
* `-n`: Print the network node hostname.
    
* `-r`: Print the kernel release.
    
* `-v`: Print the kernel version.
    
* `-m`: Print the machine hardware name.
    
* `-p`: Print the processor type.
    
* `-i`: Print the hardware platform.
    
* `-o`: Print the operating system.
    
* `-a`: Print all available system information.
    

## Examples and Use Cases

### Print the Kernel Name

```bash
uname -s
```

* Outputs the name of the kernel (e.g., `Linux`).
    

### Print the Network Node Hostname

```bash
uname -n
```

* Outputs the network node hostname (e.g., `hostname`).
    

### Print the Kernel Release

```bash
uname -r
```

* Outputs the kernel release number (e.g., `5.4.0-42-generic`).
    

### Print the Kernel Version

```bash
uname -v
```

* Outputs the kernel version (e.g., `#46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020`).
    

### Print the Machine Hardware Name

```bash
uname -m
```

* Outputs the machine hardware name (e.g., `x86_64`).
    

### Print the Processor Type

```bash
uname -p
```

* Outputs the processor type (e.g., `x86_64`). Note: may show `unknown` on some systems.
    

### Print the Hardware Platform

```bash
uname -i
```

* Outputs the hardware platform (e.g., `x86_64`). Note: may show `unknown` on some systems.
    

### Print the Operating System

```bash
uname -o
```

* Outputs the operating system (e.g., `GNU/Linux`).
    

### Print All System Information

```bash
uname -a
```

* Outputs all available system information in a single line:
    
    ```plaintext
    Linux hostname 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    ```
    

## Combining Options

You can combine multiple options to get specific pieces of information together. For example:

### Print Kernel Name and Release

```bash
uname -sr
```

* Outputs the kernel name and release:
    
    ```plaintext
    Linux 5.4.0-42-generic
    ```
    

## Additional Information

* To get help or see the full list of options, you can use:
    
    ```bash
    uname --help
    ```
    
* For detailed documentation, refer to the man page by typing:
    
    ```bash
    man uname
    ```
    

---

This cheatsheet provides a quick reference to the most common usages and options for the `uname` command. For more detailed information, you can always refer to the `uname` man page.
