Skip to content

Fixes misspell in command to identify IP address in WSL#2483

Open
evgenyvalavin wants to merge 1 commit intoMicrosoftDocs:mainfrom
evgenyvalavin:patch-1
Open

Fixes misspell in command to identify IP address in WSL#2483
evgenyvalavin wants to merge 1 commit intoMicrosoftDocs:mainfrom
evgenyvalavin:patch-1

Conversation

@evgenyvalavin
Copy link

@evgenyvalavin evgenyvalavin commented Feb 14, 2026

  1. Fixing misspelling of -I parameter which does not exist and should be -i.
  2. Removed wsl to get rid of confusion. Because the following command in the section doesn't have wsl.

Copilot AI review requested due to automatic review settings February 14, 2026 21:10
@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 55edd19:

✅ Validation status: passed

File Status Preview URL Details
WSL/basic-commands.md ✅Succeeded View

For more details, please refer to the build report.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WSL “basic commands” documentation to correct the command shown for identifying the WSL2 distribution IP address.

Changes:

  • Replaced the “identify distro IP” command in the Identify IP address section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Identify IP address

- `wsl hostname -I`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
- `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostname -i without a wsl/wsl.exe prefix changes the execution context compared to the rest of this doc (which shows PowerShell wsl commands). Also, hostname -i inside Linux commonly resolves the hostname and can return a loopback/placeholder address (e.g., 127.0.1.1) rather than the WSL2 VM interface IP. The linked networking.md#identify-ip-address section uses wsl.exe ... hostname -i for querying from Windows; if the intent is to run from Windows, update this bullet to include the wsl/wsl.exe prefix (and optionally clarify when to use -i vs -I).

Suggested change
- `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
- `wsl hostname -I`: From PowerShell or Windows Command Prompt, returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address). When run inside your Linux distribution, use `hostname -I`.

Copilot uses AI. Check for mistakes.
Copy link
Author

@evgenyvalavin evgenyvalavin Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot check the following line which doesn't have wsl too and it is confusing. what do you suggest?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +172 to 173
- `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
- `ip route show | grep -i default | awk '{ print $3}'`: Returns the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM)
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet switches from a Windows wsl ... command to a Linux hostname -i command, which conflicts with the doc’s intro stating that commands are written for PowerShell/CMD (wsl ...). Also, hostname -i commonly resolves the hostname via /etc/hosts and can return a loopback/placeholder (e.g., 127.0.1.1) rather than the WSL2 VM interface address. Consider keeping this in the same execution context as the rest of the page by using wsl/wsl.exe (and clarifying when to use -i vs -I, consistent with WSL/networking.md#identify-ip-address).

Suggested change
- `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
- `ip route show | grep -i default | awk '{ print $3}'`: Returns the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM)
- `wsl hostname -I`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
- `wsl sh -c "ip route show | grep -i default | awk '{ print \$3}'"`: Returns the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant