Created
January 25, 2022 21:08
-
-
Save prithwi/654cdadee26c8925b6c047f700c3d563 to your computer and use it in GitHub Desktop.
List conda environments with creation date.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ref: https://stackoverflow.com/a/57682857 | |
# uses both system and local conda environment | |
conda_folders=( `conda info --base`/envs $HOME/.conda/envs ) | |
echo "==> Creation Date <== Environment Name" | |
echo "#" | |
for folder in "${conda_folders[@]}"; do | |
for env_hist in "$folder"/*/conda-meta/history; do | |
env_prefix=$(dirname $(dirname $env_hist)) | |
echo "$(head -n1 $env_hist) $env_prefix" | |
done | |
done | sort -h -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment