Skip to content

A list of Linux aliases I use with Windows Subsystem for Linux (WSL) running Ubuntu. Add them to the ~/.bashrc, ~/.bash_aliases or ~/.profile in the WSL home directory. Then, restart or reload the WSL terminal environment.

Aliases

# run package update and upgrade
alias update="sudo apt update && sudo apt upgrade -y"

# ll command to show hidden files 
alias ll='ls -la' 

# open windows file explorer
alias open="explorer.exe"

# copy to clipboard
alias ccopy="clip.exe"

# goto windows user home, replace <windows-username> with Windows Username
alias winhome="cd /mnt/c/Users/<windows-username>"

# goto linux user home
alias gohome="cd ~/"

# convert windows path to wsl
alias wpath="wslpath -u"

# convert wsl to windows path
alias lpath="wslpath -m"

Usage examples

Open the current WSL directory in Windows File Explorer:

open .

Copy output to clipboard:

cat ~/.ssh/id_rsa_key.pub | ccopy

Convert Windows file path to WSL path. Note the quotes to account for the backslashes when copying from Windows File Explorer:

wpath "C:\Users\johndoe\Pictures\example.jpg"

Convert WSL to a Windows file path.

wpath /home/johndoe/another.jpg

grafts: