Linux aliases for wsl
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:
Copy output to clipboard:
Convert Windows file path to WSL path. Note the quotes to account for the backslashes when copying from Windows File Explorer:
Convert WSL to a Windows file path.
grafts: