39

Is there a way of viewing past conda transactions? For instance, a history of all conda install actions I did in the current environment would be great.

Thanks

information_interchange
  • 2,538
  • 6
  • 31
  • 49
  • 1
    Does something like reverse-i-search work for you? : As mentioned in https://unix.stackexchange.com/questions/73498/how-to-cycle-through-reverse-i-search-in-bash . Or do we need past conda commands for an environment by timestamps? – Aurgho Bhattacharjee May 10 '19 at 02:48

2 Answers2

55

There is a --revisions, -r flag for this.

conda list --revisions

Check the conda list --help for more info.

If you'd like an exact history, there is a conda-meta/history log in every environment. You could, for example, pull out every command ever executed in an environment, plus a timestamp, using

grep -B1 "^# cmd" ${CONDA_PREFIX}/conda-meta/history
merv
  • 67,214
  • 13
  • 180
  • 245
8

When you use the "my_env/conda-meta/history", it shows the exact cmd as well that as been used for the successive revisions and it shows the date as well.

For example, following is the snippet of the my_env/conda-meta/history

==> 2020-04-08 03:47:11 <==
# cmd: /home/calvin/anaconda3/bin/conda update -c nilmtk nilmtk
# conda version: 4.8.3
justCalvin
  • 81
  • 1
  • 1
  • Can you put also an example of "my_env"? – Student.py Jan 04 '22 at 16:44
  • @Student.py the example could be something like: `/home//programs/anaconda3/envs/sphinx/conda-meta`, where `sphinx` is the name of my enviroment. Then the `history` file is basically a text file without suffix, thus you can view it in unix's shell e.g. like this `less history` – Forrest1988 Oct 28 '22 at 13:23