# OS Detection

#### Enable OS Detection (`-O`)

**Explanation:** This enables the OS detection feature to attempt to determine the operating system of the target.

```bash
nmap -O <target>
```

#### Limit OS Detection to Promising Targets (`--osscan-limit`)

**Explanation:** This option restricts OS detection to targets that have at least one open and one closed TCP port, saving time on scans.

```bash
nmap -O --osscan-limit <target>
```

#### Guess OS Detection Results (`--osscan-guess` or `--fuzzy`)

**Explanation:** If Nmap is unsure about the OS, it will make more aggressive guesses and provide near-matches with confidence levels.

```bash
nmap -O --osscan-guess <target>
```

#### Set the Maximum Number of OS Detection Tries (`--max-os-tries`)

**Explanation:** This option sets the maximum number of attempts Nmap will make when trying to detect the OS. Reducing the number can speed up scans, while increasing it may improve accuracy.

```bash
nmap -O --max-os-tries 3 <target>
```
