For decades, the humble .bashrc file was the exclusive domain of Linux and macOS users—a hidden fortress of aliases, custom prompts, and PATH exports. But with Windows 11 embracing the Linux ecosystem like never before, a new question haunts developers: Where does my .bashrc actually live?
If you’ve installed WSL (Windows Subsystem for Linux), Git Bash, or MSYS2, you technically have a Bash shell. But placing a .bashrc file on your Windows desktop won’t work. Here’s where to find—and create—your configuration file depending on how you’re running Bash on Windows 11. If you’re using Windows 11’s flagship Linux integration (WSL2), your .bashrc does not live in C:\Users\YourName . It lives inside the Linux distribution’s virtual file system.
Never edit this file with Notepad or WordPad. Use nano , vim , or VS Code’s WSL remote extension. Windows apps can add carriage returns ( \r\n ) that break the Bash parser. 2. The Git Bash Dev: Hidden in Your User Profile Many Windows 11 developers install Git for Windows, which comes with Git Bash —a lightweight Bash emulator. Git Bash does not read a Linux file system; it reads Windows files but expects Unix line endings.
C:\msys64\home\YourWindowsUsername\.bashrc (for MSYS2)
When you launch WSL, you land in your Linux home directory:
| Tool | File System | .bashrc lives in | |------|-------------|--------------------| | | Virtual Linux | \\wsl.localhost\Ubuntu\home\username\ | | Git Bash | Native Windows | C:\Users\username\ | | MSYS2 | Hybrid | C:\msys64\home\username\ |
For decades, the humble .bashrc file was the exclusive domain of Linux and macOS users—a hidden fortress of aliases, custom prompts, and PATH exports. But with Windows 11 embracing the Linux ecosystem like never before, a new question haunts developers: Where does my .bashrc actually live?
If you’ve installed WSL (Windows Subsystem for Linux), Git Bash, or MSYS2, you technically have a Bash shell. But placing a .bashrc file on your Windows desktop won’t work. Here’s where to find—and create—your configuration file depending on how you’re running Bash on Windows 11. If you’re using Windows 11’s flagship Linux integration (WSL2), your .bashrc does not live in C:\Users\YourName . It lives inside the Linux distribution’s virtual file system. bashrc file location windows 11
Never edit this file with Notepad or WordPad. Use nano , vim , or VS Code’s WSL remote extension. Windows apps can add carriage returns ( \r\n ) that break the Bash parser. 2. The Git Bash Dev: Hidden in Your User Profile Many Windows 11 developers install Git for Windows, which comes with Git Bash —a lightweight Bash emulator. Git Bash does not read a Linux file system; it reads Windows files but expects Unix line endings. For decades, the humble
C:\msys64\home\YourWindowsUsername\.bashrc (for MSYS2) But placing a
When you launch WSL, you land in your Linux home directory:
| Tool | File System | .bashrc lives in | |------|-------------|--------------------| | | Virtual Linux | \\wsl.localhost\Ubuntu\home\username\ | | Git Bash | Native Windows | C:\Users\username\ | | MSYS2 | Hybrid | C:\msys64\home\username\ |