WSL Bash Windows Username Output

Display Windows Username from WSL Bash

This article introduces a method to output the Windows username from the WSL Linux Bash command line, rather than the WSL Bash Linux username.

Shou Arisaka
1 min read
Oct 7, 2025

This article introduces a method to output the Windows username from the WSL Linux Bash command line, rather than the WSL Bash Linux username.

echo $(cmd.exe /c “echo %USERNAME%”)

The above command is executed in the following steps:

  1. cmd.exe /c “echo %USERNAME%” is executed, and the Windows username is output.
  2. echo $(cmd.exe /c “echo %USERNAME%”) is executed, and the Windows username output in step 1 is displayed.

Share this article

Shou Arisaka Oct 7, 2025

🔗 Copy Links