How to create shortcut to access Windows files in Windows Subsystem for Linux (WSL)

Often times, you may find yourself accessing Windows files from Windows Subsystem for Linux (WSL). The Windows drives can be found via /mnt. From there on, you can cd to any drive such as cd /mnt/c. An path for Windows document files would be something something like /mnt/c/Users/<my_user>/Documents.

However, it is often tedious to cd into the Windows user directory as I often do. Fortunately, you can make the process simpler with the creation of symlinks.

ln -s /mnt/c/Users/<my_user>/ ~/win

Instead of having to do cd /mnt/c/Users/<my_user> every single time, you can now just do cd ~/win to go to the same directory.

If you wish to remove the symlink, just do a regular rm just like how you would remove any other file e.g. rm ~/win.

Wei-Ming Thor

I write guides on programming, mostly on how to be awesome at JavaScript.

Background

I am a full-stack engineer who builds web and mobile apps.

Writing unmaintainable code since 2010.

Skill/languages

Best: JavaScript, Python, C
Others: Android, iOS, React Native, Ruby, PHP

Location

Kuala Lumpur, Malaysia