diff --git a/dot_bashrc.d/executable_09.functions.tmpl b/dot_bashrc.d/executable_09.functions.tmpl index 5b3fba7..0b663d5 100755 --- a/dot_bashrc.d/executable_09.functions.tmpl +++ b/dot_bashrc.d/executable_09.functions.tmpl @@ -113,6 +113,8 @@ list-ssh-keys() { done } +{{ if eq .chezmoi.os "linux" }} +{{ if eq .chezmoi.osRelease.id "debian" }} # Show version of a Debian package debversion() { if [ -x dpkg ]; then @@ -135,6 +137,20 @@ deblist() { fi } +# Show apt installation history +debhistory() { + zcat /var/log/apt/history.log.*.gz | \ + /usr/bin/cat - /var/log/apt/history.log | \ + grep -Po '^Commandline:(?= apt)(?=.* install ) \K.*|^Start-Date: \K.*' | \ + grep -B1 "^apt" | \ + grep -v -- "^--" | \ + paste -d " " - - | \ + sort +} + +{{ end }} +{{ end }} + # Run 'top' by a list of processes matching name. topby() { local name=${1:?name required}