Skip to content

Instantly share code, notes, and snippets.

@rwanyoike
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwanyoike/b118fccd8b760557ece9 to your computer and use it in GitHub Desktop.
Save rwanyoike/b118fccd8b760557ece9 to your computer and use it in GitHub Desktop.
Identify files not owned by any package
#!/usr/bin/env sh
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
db=$tmp/db
fs=$tmp/fs
mkdir "$tmp"
trap 'rm -rf "$tmp"' EXIT
pacman -Qlq | sort -u > "$db"
find /etc /opt /usr ! -name lost+found \( -type d -printf '%p/\n' -o -print \) | sort > "$fs"
comm -23 "$fs" "$db"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment