Sorry command had a typo, this is correct: for i in $(grep -Rl 'MimeType=.*/.*' /usr/share/applications/*); do pkg= $(LANG=C pacman -Qo "$i"); grep -L update-desktop-database /var/lib/pacman/local/$(echo $pkg | cut -d\ -f5)-$(echo $pkg | cut -d\ -f6)/install; done