ls -l /opt/anaconda3/lib/python3.7/site-packages/ | grep "\-info" | awk '{print $NF}' | awk -F'-' '{print $1}' | sort > 37.txt
ls -l /opt/anaconda3_3.6/lib/python3.6/site-packages/ | grep "\-info" | awk '{print $NF}' | awk -F'-' '{print $1}' | sort > 36.txt
# 未安装的package
cat 36.txt 37.txt | sort | uniq -d | cat 36.txt - | sort | uniq -u
# cat 36.txt 37.txt | sort | uniq > union.txt
# cat 36.txt 37.txt | sort | uniq -u > complement.txt
# cat 36.txt 37.txt | sort | uniq -d > intersection.txt
原文:https://www.cnblogs.com/bregman/p/10912761.html