#!/bin/sh # uses pacman to check if a file belongs to any installed package for file in "$@" do if [ -d "$file" ]; then continue fi files=$files" $file" done pacman -Qo $files > /dev/null