dotfiles/NOVA/usr/local/bin/appremove-testy

19 lines
395 B
Plaintext
Raw Permalink Normal View History

2015-04-12 23:06:28 +00:00
#!/bin/bash
declare -A usage
exec 0< <(pacman -Ql | grep bin)
while read pkg binary; do
lastused=$(stat -c '%X' "$binary")
if [[ -z ${usage[$pkg]} ]] || (( lastused > ${usage[$pkg]} )); then
usage[$pkg]=$lastused
fi
done
for key in "${!usage[@]}"; do
printf '%s\t%s\n' "${usage[$key]}" "$key"
done | sort -rn | while read time pkg; do
printf '%(%c)T\t%s\n' "$time" "$pkg"
done