Created
November 26, 2012 04:59
-
-
Save mitchejj/4146675 to your computer and use it in GitHub Desktop.
Show recently installed packages
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 | |
# Show recently installed packages | |
# http://crunchbang.org/forums/viewtopic.php?id=23273 | |
DATE="$1" | |
DIR=/tmp/$USER-${0##*/} | |
if [ ! -d $DIR ]; then | |
mkdir $DIR | |
fi | |
cat /var/log/dpkg.log* | grep $DATE | grep "\ install\ " | awk ' { print $4" "substr($0,length($0)-8) }' | egrep -o '^[^:]+' | sort > $DIR/installed | |
cat /var/log/dpkg.log* | grep $DATE | grep "\ remove\ " | awk ' { print $4" "substr($0,length($0)-8) }' | egrep -o '^[^:]+' | sort > $DIR/removed | |
KEPT=`comm -23 $DIR/installed $DIR/removed` | |
printf "INSTALLED PACKAGES:\n`cat $DIR/installed`\n" | |
printf "REMOVED PACKAGES:\n`cat $DIR/removed`\n" | |
printf "PACKAGES INSTALLED BUT NOT REMOVED:\n$KEPT\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment