#!/bin/sh pacman -Qei | grep -P "^(Name|Install Date)" | sed -r ":a;N;s/Name\s+: (.*)\nInstall Date\s+: (.*)/\2\t\1/" | while read pkg_date pkg_name; do echo -e $(date +0%F\ %T --date="$pkg_date") '\t' $pkg_name; done | sort # Need to fix dates and sorting