Skip to content

Instantly share code, notes, and snippets.

@socketbox
Created September 17, 2022 21:58
Show Gist options
  • Save socketbox/d4bdb1c3c5f282351c451cfcb6102f10 to your computer and use it in GitHub Desktop.
Save socketbox/d4bdb1c3c5f282351c451cfcb6102f10 to your computer and use it in GitHub Desktop.
Use grep and awk to delete multiple pyenv envs matching a pattern
for foo in $(pyenv virtualenvs | grep --color=NEVER "^\s\sk" | awk -F" " '{print $1}');
do
pyenv virtualenv-delete -f $foo;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment