Skip to content

Instantly share code, notes, and snippets.

@bartdorsey
Last active December 1, 2022 08:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartdorsey/c33a3b2045753b255bc0a058010427b7 to your computer and use it in GitHub Desktop.
Save bartdorsey/c33a3b2045753b255bc0a058010427b7 to your computer and use it in GitHub Desktop.
WSL Cheatsheet

WSL Cheatsheet

Powershell commands

Listing out your WSL machines

wsl -l -v

Shutting down a specific WSL machine

wsl --terminate <name>

Shutting down WSL

wsl --shutdown

Ubuntu Commands

Installing Python

Ubuntu already includes python preinstalled, you just have to install this to use python instead of python3

sudo apt install python-is-python3

Installing Node (using Fast Node Manager)

sudo apt install unzip
curl -fsSL https://fnm.vercel.app/install | bash
# Then restart your terminal
fnm install --lts

Opening Windows Explorer from WSL

explorer.exe .

Opening the current folder in VSCode

Make sure you install the WSL extension in VSCode

code .

Changing your shell to zsh

Note: if you have already installed node or other things that have modified your .bashrc, you will need to make those changes to .zshrc after you swap from bash to zsh

sudo apt install zsh
chsh

Installing the starship prompt

curl -sS https://starship.rs/install.sh | sh

Then follow the instructions it gives you to add lines to your shell startup file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment