Last active
September 9, 2015 20:53
Revisions
-
glarrain revised this gist
Sep 9, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ #!/bin/bash # source: https://help.ubuntu.com/community/ListInstalledPackagesByDate #creates text file with a list of all packages installed by date #first append all info from archived logs -
glarrain created this gist
Sep 9, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ #!/bin/bash #pkginstalls.sh #creates text file with a list of all packages installed by date #first append all info from archived logs i=2 mycount=$(ls -l /var/log/dpkg.log.*.gz | wc -l) nlogs=$(( $mycount + 1 )) while [ $i -le $nlogs ] do if [ -e /var/log/dpkg.log.$i.gz ]; then zcat /var/log/dpkg.log.$i.gz | grep "\ install\ " >> $HOME/pkgtmp.txt fi i=$(( $i+1 )) done #next append all info from unarchived logs i=1 nulogs=$(ls -l /var/log/dpkg.log.* | wc -l) nulogs=$(( $nulogs - $nlogs + 1 )) while [ $i -le $nulogs ] do if [ -e /var/log/dpkg.log.$i ]; then cat /var/log/dpkg.log.$i | grep "\ install\ " >> $HOME/pkgtmp.txt fi i=$(( $i+1 )) done #next append current log cat /var/log/dpkg.log | grep "\ install\ " >> $HOME/pkgtmp.txt #sort text file by date sort -n $HOME/pkgtmp.txt > $HOME/pkginstalls.txt rm $HOME/pkgtmp.txt exit 0